Developer Docs

Build with Bink

Integrate Sign in with Bink into your app, or access the Bink API directly using a personal access token.

SSO

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.

Sign in with Bink

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.

Just like "Sign in with Google" or "Sign in with Apple", but open to any platform. OAuth 2.0
For third-party apps

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

NameURL
Authorizationhttps://bink.link/api/oauth/authorize
Token exchangehttps://bink.link/api/oauth/token
User infohttps://bink.link/api/oauth/user
  1. 1

    Get your credentials

    Contact us at dev@binatomy.com to register your app and receive a client_id and client_secret. Provide your app name, description, and the redirect URI you plan to use.
  2. 2

    Redirect the user to the authorization endpoint

    Build the authorization URL and redirect your user there:
    typescript
    const 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}`;
    The user will see a Bink login page and a consent screen. After approval they are redirected back to your redirect_uri with a code query parameter.
  3. 3

    Exchange the code for an access token

    On your server, exchange the code for a token:
    typescript
    const 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. 4

    Fetch the user profile

    Use the access token to retrieve the authenticated user:
    typescript
    const profile = await fetch('https://bink.link/api/oauth/user', {
      headers: { Authorization: `Bearer ${access_token}` },
    }).then(r => r.json());
    
    console.log(profile.username); // "federico"
Quickest way to start

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. 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. 2

    Use the token in your requests

    Pass the token in the Authorization header:
    bash
    curl https://bink.link/api/oauth/user \
      -H "Authorization: Bearer bink_your_token_here"
  3. 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
    }
Tokens never expire by default. You can revoke them at any time from your Settings.

API Reference

All endpoints accept and return JSON unless otherwise noted.

GET/api/oauth/user

Returns 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
}
GET/api/oauth/authorize

Starts the OAuth 2.0 authorization flow. Redirects to the Bink login / consent page.

Auth: None

Parameters

client_idrequiredYour registered client ID
redirect_urirequiredMust match registered URI exactly
response_typerequiredMust be "code"
POST/api/oauth/token

Exchanges an authorization code for an access token.

Auth: None

Parameters

grant_typerequired"authorization_code"
coderequiredThe code from the redirect
client_idrequired
client_secretrequired
redirect_urirequiredSame 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

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

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

bash
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.