Login with Strave
Sign players in with Strave and get their Ubisoft accounts, Siege profiles, and Discord account in one login.
Login with Strave gives your app the Siege identity of a player. One sign-in returns the Ubisoft accounts, the Siege profiles on each platform, and the Discord account that the player linked on Strave. You don't call the API for this data, and it doesn't count against a quota.
This page shows the identity scopes and their claims. For the full OAuth flow and the other credentials, see Authentication.
Identity scopes
Request these scopes together with openid. The ID token and the userinfo
endpoint then contain the matching claims:
| Scope | Claim | Contains |
|---|---|---|
siege | siege | The linked Siege profiles and their Ubisoft accounts |
discord | discord | The ID of the linked Discord account |
The identity scopes are free on every plan. They are not Strave permissions, so you don't add them to your Application, and they don't need a paid organisation.
Claims
The claims use the same names in the ID token and in the userinfo response. This example shows a player with a PC and a console profile:
{
"sub": "j97a2kq8m4n5p6r7s8t9v0w1",
"siege": {
"primary_platform": "pc",
"profiles": [
{
"platform": "console",
"profile_id": "9a1c4f2e-7b3d-4e8a-9c6f-1d2e3f4a5b6c",
"ubisoft_user_id": "e3d5b7a9-1c2e-4f6a-8b0d-2e4f6a8c0e1f",
"name": "Gonzo-eLevate",
"linked_at": 1762000000,
"verification": "claimed"
},
{
"platform": "pc",
"profile_id": "e3d5b7a9-1c2e-4f6a-8b0d-2e4f6a8c0e1f",
"ubisoft_user_id": "e3d5b7a9-1c2e-4f6a-8b0d-2e4f6a8c0e1f",
"name": "GNZO.strave",
"linked_at": 1761000000,
"verification": "claimed"
}
]
},
"discord": { "id": "238472916384729163" }
}The fields of each profile are:
platform:pcorconsole.profile_id: the platform profile ID. Stats sites and Strave matches use this ID. On PC, it's the same as the Ubisoft account ID.ubisoft_user_id: the Ubisoft account that owns the profile.name: the current profile name.linked_at: when the player linked the profile, in Unix seconds.verification: how strongly Strave knows that the player owns the profile.
primary_platform is the platform whose profile name the player shows on
Strave, or null. A claim is null when the player linked no profile or no
Discord account.
Verification levels
The verification field tells you how much you can trust a profile link.
Today every profile has the level claimed: the player selected the profile,
and no other Strave account holds the same Ubisoft account.
Strave adds stronger levels later. Treat an unknown value like claimed, so
your code keeps working when a new level arrives.
claimed doesn't prove that the player owns the Ubisoft account. Don't use it
alone for prizes, payouts, or bans.
Keep the data current
The ID token is a copy of the data at sign-in. Players can rename a profile, link a new one, or remove a link later. To get the current data, call the userinfo endpoint with the access token:
GET https://strave.gg/api/auth/oauth2/userinfo
Authorization: Bearer <access token>Add offline_access to the scopes to get a refresh token, so you can read
userinfo after the access token expires.
Add Login with Strave with Better Auth
The @strave/auth package has a
preset for the Better Auth generic OAuth plugin
(Better Auth 1.7 or later), helpers for the claims, and the Login with Strave
button. Complete these steps:
-
Create an Application in your developer portal and add
https://your-app.com/api/auth/callback/straveas a redirect URI. -
Install the package:
bun add @strave/auth -
Add the preset to your Better Auth server:
import { betterAuth } from "better-auth"; import { genericOAuth } from "better-auth/plugins"; import { strave, straveUserFields } from "@strave/auth/better-auth"; export const auth = betterAuth({ user: { additionalFields: straveUserFields }, plugins: [ genericOAuth({ config: [ strave({ clientId: process.env.STRAVE_CLIENT_ID!, clientSecret: process.env.STRAVE_CLIENT_SECRET, storeIdentity: true, }), ], }), ], });The preset reads the endpoints from the discovery document, uses PKCE, and requests
openid profile email siege discord. WithstoreIdentity, each sign-in writessiegeName,siegeIdentity, anddiscordIdto the user. Run your Better Auth migration after you addstraveUserFields. -
Show the button and start the sign-in from your client:
import { LoginWithStraveButton } from "@strave/auth/react"; <LoginWithStraveButton onClick={() => authClient.signIn.social({ provider: "strave", callbackURL: "/dashboard", }) } />;
To read the current claims on your server, call fetchStraveUserInfo from
@strave/auth with the access token. primarySiegeProfile returns the
profile that the player shows on Strave.
If you don't use the package, configure the generic OAuth plugin yourself as
Authentication shows, and add
siege and discord to the scopes.
Use an app without an Application
Apps that register themselves through OAuth dynamic client registration
(RFC 7591) can also request openid, profile, siege, and discord. You
don't need the developer portal for this. Register a public client at
https://strave.gg/api/auth/oauth2/register and use the returned client ID.
These clients have some restrictions:
- The consent page shows Not verified by Strave.
- They can't request
email. Libraries that need an email address to create a user, such as Better Auth, need an Application. - The Public API rejects their tokens. To call the API, create an Application.
Use Login with Strave from an AI coding tool
You can paste this block into an AI coding tool, such as Cursor, Claude Code, or v0, to add Login with Strave to your app:
Add "Login with Strave" to my app with the npm package @strave/auth.
Better Auth: use strave() from "@strave/auth/better-auth" in genericOAuth,
with storeIdentity: true and straveUserFields in user.additionalFields.
Other stacks: add an OpenID Connect provider with the discovery document
https://strave.gg/api/auth/.well-known/openid-configuration
Scopes: openid profile email siege discord
Use the authorization code flow with S256 PKCE.
Read the "siege" claim from userinfo: { primary_platform, profiles: [{ platform,
profile_id, ubisoft_user_id, name, linked_at, verification }] } or null.
Read the "discord" claim: { id } or null.
Show the button LoginWithStraveButton from "@strave/auth/react".
Treat any verification value other than a known one like "claimed".
Docs: https://strave.gg/docs/api/login-with-straveNext steps
- Authentication: the full OAuth flow, refresh tokens, and credentials for your server.
- Developer controls: create and manage your Application.