Build with Bink
Integrate Sign in with Bink into your app, or access the Bink API directly using a personal access token.
Add "Sign in with Bink" to your platform
Give your users a frictionless login experience — like "Sign in with Google", but connected to their Bink digital identity.
For Businesses & Developers
Zero password management
You never handle or store user passwords. Authentication is delegated to Bink.
Verified identities
Bink users can be passkey-verified (blue badge) or trusted (gold badge). Your app knows who it's dealing with.
Faster onboarding
Users can sign up to your service in one click. No forms, no email confirmation, no friction.
Industry standard
Built on OAuth 2.0 — the same protocol used by Google, GitHub, and Apple. Works with any stack.
OAuth 2.0 — Sign in with Bink
Let your users authenticate using their Bink account. Bink implements the standard OAuth 2.0 Authorization Code flow.
Endpoints
| Name | URL |
|---|---|
| Authorization | https://bink.link/api/oauth/authorize |
| Token exchange | https://bink.link/api/oauth/token |
| User info | https://bink.link/api/oauth/user |
- 1
Get your credentials
Contact us at dev@binatomy.com to register your app and receive aclient_idandclient_secret. Provide your app name, description, and the redirect URI you plan to use. - 2
Redirect the user to the authorization endpoint
Build the authorization URL and redirect your user there:The user will see a Bink login page and a consent screen. After approval they are redirected back to yourtypescriptconst params = new URLSearchParams({ client_id: 'YOUR_CLIENT_ID', redirect_uri: 'https://yourapp.com/callback', response_type: 'code', }); // Redirect the user window.location.href = `https://bink.link/api/oauth/authorize?${params}`;redirect_uriwith acodequery parameter. - 3
Exchange the code for an access token
On your server, exchange the code for a token:typescriptconst res = await fetch('https://bink.link/api/oauth/token', { method: 'POST', headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, body: new URLSearchParams({ grant_type: 'authorization_code', code: code, // from query param client_id: 'YOUR_CLIENT_ID', client_secret: 'YOUR_CLIENT_SECRET', redirect_uri: 'https://yourapp.com/callback', }), }); const { access_token, token_type, expires_in } = await res.json(); - 4
Fetch the user profile
Use the access token to retrieve the authenticated user:typescriptconst profile = await fetch('https://bink.link/api/oauth/user', { headers: { Authorization: `Bearer ${access_token}` }, }).then(r => r.json()); console.log(profile.username); // "federico"
Personal Access Tokens
A personal access token (PAT) lets you authenticate as yourself against the Bink API — perfect for personal scripts, automations, and integrations.
- 1
Generate a token
Go to Settings and scroll to the Developer section at the bottom. Click + Create Token, give it a name, and copy the token — it will be shown only once. - 2
Use the token in your requests
Pass the token in theAuthorizationheader:bashcurl https://bink.link/api/oauth/user \ -H "Authorization: Bearer bink_your_token_here"
- 3
Read the response
A successful response returns the authenticated user's public profile:json{ "id": "cuid...", "name": "Federico", "email": "you@example.com", "username": "federico", "avatar": "https://...", "plan": "FREE", "verificationLevel": 0 }
API Reference
All endpoints accept and return JSON unless otherwise noted.
/api/oauth/userReturns the authenticated user's public profile.
Auth: Bearer token (PAT or OAuth)
Response
{
"id": string,
"name": string | null,
"email": string | null,
"username": string | null,
"avatar": string | null,
"plan": "FREE" | "VERIFIED" | "BUSINESS",
"verificationLevel": 0 | 1 | 2
}/api/oauth/authorizeStarts the OAuth 2.0 authorization flow. Redirects to the Bink login / consent page.
Auth: None
Parameters
| client_id | required | Your registered client ID |
| redirect_uri | required | Must match registered URI exactly |
| response_type | required | Must be "code" |
/api/oauth/tokenExchanges an authorization code for an access token.
Auth: None
Parameters
| grant_type | required | "authorization_code" |
| code | required | The code from the redirect |
| client_id | required | |
| client_secret | required | |
| redirect_uri | required | Same URI used in authorization step |
Response
{
"access_token": string,
"token_type": "Bearer",
"expires_in": 3600
}SDK & Examples
Use any HTTP client. Here are copy-paste examples for common environments.
Node.js / TypeScript
// Install: npm install bink-sdk (coming soon)
// Or use the REST API directly:
async function getBinkUser(token: string) {
const res = await fetch('https://bink.link/api/oauth/user', {
headers: { Authorization: `Bearer ${token}` },
});
if (!res.ok) throw new Error('Invalid token');
return res.json() as Promise<{
id: string;
name: string | null;
email: string | null;
username: string | null;
avatar: string | null;
plan: 'FREE' | 'VERIFIED' | 'BUSINESS';
verificationLevel: number;
}>;
}
// Usage:
const user = await getBinkUser('bink_your_token');
console.log(`Hello, ${user.username}!`);Python
import requests
def get_bink_user(token: str) -> dict:
response = requests.get(
"https://bink.link/api/oauth/user",
headers={"Authorization": f"Bearer {token}"},
)
response.raise_for_status()
return response.json()
user = get_bink_user("bink_your_token")
print(f"Hello, {user['username']}!")cURL
curl https://bink.link/api/oauth/user \ -H "Authorization: Bearer bink_your_token_here"
Ready to integrate?
Generate a token in your settings or contact us to register an OAuth client.