At Pica, we dogfood our own products. AuthKit powers the connection experience in Pica’s dashboard. Create a free account, navigate to the Connected Integrations tab, click the “Add Connection” button, and voilà - you’ll see AuthKit in action!
Overview
Think of AuthKit as the “Plaid for integrations”. Implementing authentication flows that handle every possible error state and edge case across multiple integrations can be a daunting task. AuthKit makes this easy by providing a hosted, pre-built, customizable authentication UI with automatic handling of:- Secure authentication via OAuth and API Keys
- Automatic handling of authentication and refresh tokens
- Self-hosted OAuth apps (using your Client ID and Client Secret)
- Customizable branding and white labeling
Setup
1
Install the AuthKit token generator package
2
Set your Pica API key as an environment variable
Navigate to the Pica API keys tab, and create a new API key and set the
PICA_SECRET_KEY
environment variable to the value of the API key.3
Create an API endpoint to generate a token
For this example, we’ll use Next.js and create an API endpoint at
api/authkit
.Parameter | Type | Description |
---|---|---|
identity | string | A meaningful identifier for the user, team, or organization that will own the connection (e.g. userId, teamId, organizationId). This label is how you will identify and filter connections. |
identityType | "user" | "team" | "organization" | "project" | Specifies whether the identity represents a user, team, organization, or project |
4
Install the AuthKit client package
5
Create a button to open the AuthKit modal
6
Enable the integrations you want visible
Navigate to the AuthKit tab, and toggle the integrations you want to enable in the AuthKit modal. For OAuth integrations, you’ll need to provide the Client ID and Client Secret for your app.
Demo
Check out our example Next.js app using AuthKit
Making requests to authenticated endpoints
Once you’ve created a connection, you can make requests to the authenticated endpoints of the integration using the Passthrough API or the OneTool SDK based on the connection key.Need help? Email us at support@picaos.com and we’ll be happy to help you out.