Documentation navigation
← Back to Jupiter Auth

Anonymous Users

Create an authenticated session before requiring the user to provide an external identity.

Create an anonymous session

signInAnonymously creates a user without an external identity and immediately returns an authenticated user and session. Optional attributes are stored with the user.

const result = await client.auth.signInAnonymously({  attributes: {    onboardingStep: 1  }}) if (result.error) {  throw result.error} console.log(result.data.user)console.log(result.data.session)

Attach an identity later

After the anonymous user is signed in, link an OAuth or OIDC identity with linkIdentity.

const result = await client.auth.linkIdentity({  provider: 'github',  options: {    redirectTo: 'https://app.example.com/auth/callback'  }}) if (result.error) {  throw result.error}