Skip to content

scopedKeys

scopedKeys<P, K>(params): `openid:${{ apple: "https://appleid.apple.com"; google: "https://accounts.google.com"; microsoft: "https://login.microsoftonline.com/{tid}/v2.0" }[P]}:${K}`[]

Defined in: auth-client.ts:564

Scopes attribute keys to an OpenID provider.

When using one-click sign-in, attributes can be scoped to the same provider so the user grants access in a single step without an additional prompt.

P extends "google" | "apple" | "microsoft"

K extends string = "name" | "email" | "verified_email"

readonly K[]

The attribute keys to scope. Defaults to ['name', 'email', 'verified_email'].

P

The OpenID provider the keys should be scoped to.

`openid:${{ apple: "https://appleid.apple.com"; google: "https://accounts.google.com"; microsoft: "https://login.microsoftonline.com/{tid}/v2.0" }[P]}:${K}`[]

The scoped attribute keys as openid:<provider-url>:<key>.

scopedKeys({ openIdProvider: 'google', keys: ['email'] });
// ['openid:https://accounts.google.com:email']