1. Create an OAuth client
First, create an OAuth client to enable user authentication:- Go to https://app.cal.com/settings/developer/oauth
- Create a new OAuth client with:
- Name: Your application name
- Redirect URIs: URLs where users are redirected after authorization (e.g.,
https://yourapp.com/callback)
2. Implement the OAuth flow
When a user wants to connect their Cal.com account:- Redirect to authorization URL
- Handle the callback
code parameter.
- Exchange code for tokens
3. Set up a token refresh endpoint
Access tokens expire after 30 minutes. Create an endpoint that atoms can call to refresh tokens:4. Install the atoms package
- npm
- yarn
- pnpm
5. Tailwind version compatibility
If your project utilizes Tailwind CSS, please ensure you import the CSS bundle that corresponds to your specific version. Atoms provides two distinct bundles to maintain compatibility across versions:- Tailwind CSS v4:
- Tailwind CSS v3:
6. Configure the OAuth provider
For atoms to work, the root of your application must be wrapped with
CalOAuthProvider. This provider handles authentication and token management for all atoms in your app.7. Start using atoms
Now you can use any atom in your components:Previous: Introduction
Overview of Cal.com Atoms
Next: Booker Atom
Embed booking functionality