Redirect Users to Authorization URLConstruct the authorization URL with your client_id and callback_url:
Copy
Ask AI
const authUrl = new URL("https://clerk.coloop.ai/oauth/authorize");authUrl.searchParams.append("client_id", "your_client_id");authUrl.searchParams.append("redirect_uri", "your_callback_url");authUrl.searchParams.append("response_type", "code");authUrl.searchParams.append("scope", "email profile");// Redirect user to authUrl
Handle the CallbackAfter authorization, CoLoop redirects to your callback URL with an authorization code:
Copy
Ask AI
// Example callback URL:// https://your-domain.com/oauth2/callback?code=abc123...
Exchange Code for TokensMake a POST request to the token endpoint: