factory:AuthProviderClientFactory<UserApiKeyAuthProviderClient> = new classimplements AuthProviderClientFactory<UserApiKeyAuthProviderClient> {public getClient(authRequestClient: StitchAuthRequestClient,requestClient: StitchRequestClient, // This arg is ignoredroutes: StitchAuthRoutes): UserApiKeyAuthProviderClient {return new UserApiKeyAuthProviderClientImpl(authRequestClient, routes);}}()
Methods
createApiKey
createApiKey(name: string): Promise<UserApiKey>
Creates a user API key that can be used to authenticate as the current user.
Parameters
name: string
the name of the API key to be created.
Returns Promise<UserApiKey>
deleteApiKey
deleteApiKey(keyId: ObjectID): Promise<void>
Deletes a user API key associated with the current user.
Parameters
keyId: ObjectID
the id of the API key to delete
Returns Promise<void>
disableApiKey
disableApiKey(keyId: ObjectID): Promise<void>
Disables a user API key associated with the current user.
Parameters
keyId: ObjectID
the id of the API key to disable
Returns Promise<void>
enableApiKey
enableApiKey(keyId: ObjectID): Promise<void>
Enables a user API key associated with the current user.
Parameters
keyId: ObjectID
the id of the API key to enable
Returns Promise<void>
fetchApiKey
fetchApiKey(keyId: ObjectID): Promise<UserApiKey>
Fetches a user API key associated with the current user.
Parameters
keyId: ObjectID
the id of the API key to fetch.
Returns Promise<UserApiKey>
fetchApiKeys
fetchApiKeys(): Promise<UserApiKey[]>
Fetches the user API keys associated with the current user.
UserApiKeyAuthProviderClient
A client for creating, updating, and deleting the API keys of a Stitch user.