#what is the typescript type for the default export in auth.config.ts?

4 messages · Page 1 of 1 (latest)

humble walrus
#

what is the typescript type for the default export in auth.config.ts?

long breachBOT
#

Hi @humble walrus. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:

#

The knowledge sources do not explicitly state the TypeScript type for the default export in auth.config.ts. However, from the provided examples, the default export is always an object with a providers array, where each provider is an object with specific fields depending on the authentication method (e.g., domain, applicationID, type, issuer, jwks, algorithm).

For example:

export default {
  providers: [
    {
      domain: process.env.CONVEX_SITE_URL,
      applicationID: "convex",
    },
  ],
};

or for custom JWT:

export default {
  providers: [
    {
      type: "customJwt",
      applicationID: "via-auth",
      issuer: "<https://api.workos.com",>
      jwks: `<https://api.workos.com/sso/jwks/${process.env.WORKOS_CLIENT_ID}`,>
      algorithm: "RS256",
    },
  ],
};

While the exact TypeScript type is not documented in the sources, it is clear that the default export should be an object with a providers property, which is an array of provider configuration objects. The structure of each provider object depends on the authentication provider being used. If you need the precise type, you may need to refer to the Convex SDK source code or TypeScript definitions, as the documentation does not provide a named type for this export.

If you are using an editor with TypeScript support and the Convex packages installed, you can often get the correct type via autocompletion or by inspecting the expected type for the providers array in auth.config.ts based on the Convex SDK you are using.

#

Summary:

  • The default export is an object with a providers array.
  • Each provider object has fields specific to the authentication method.
  • The exact TypeScript type is not specified in the documentation provided above.

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: