最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

google cloud platform - How do I make firebase apphosting have access to secret manager values? - Stack Overflow

programmeradmin1浏览0评论

I'm trying to deploy a GitHub repository through Firebase's apphosting on a website with NextJS 15, but I can't access the environment variables of GCP secret manager.

When I try to deploy, I get a type error like this. (it seems like I can't get the value)

Type error: Argument of type '{ apiKey: string | undefined; cookieName: string; cookieSignatureKeys: string[]; cookieSerializeOptions: { path: string; httpOnly: boolean; secure: boolean; sameSite: "strict"; maxAge: number; }; serviceAccount: { ...; }; }' is not assignable to parameter of type 'SetAuthCookiesOptions'. The types of 'serviceAccount.projectId' are incompatible between these types.

I added all the code like this to the apphosting.yaml file and also allowed access using the grantaccess command.

env:
  - variable: NEXT_PUBLIC_FIREBASE_API_KEY
    secret: API_KEY
    availability:
      - BUILD
      - RUNTIME

I am referencing this code (next_public_ is in development but I am using it in deployment. Could this be a problem?)

apiKey: process.env.NEXT_PUBLIC_FIREBASE_API_KEY
发布评论

评论列表(0)

  1. 暂无评论