Guide
How to let a user connect their accounts
A user's own calendar, mail or notes sit outside your app. This guide shows how a person approves a connection to their own account through Harny, so the app's AI can read from it.
The problem
Your app's AI works best when it can see what the person already has in other tools. Those tools sit outside your app.
A connected account lets the person grant that access by approving a link. The app's developer starts the connection from the server.
How it works in Harny
Your server calls POST /v1/context-sources/{provider}/connect for a provider. The person connects their own account by approving a link.
Supported providers are gmail, calendar, drive, notion, slack and email_bridge. Gmail, Calendar and Drive connect once Harny has approved Google access for your app. You request that in the console.
Sync, list and disconnect exist for connected accounts. Disconnect (DELETE /v1/context-sources/{provider}) ends your app's access. For gmail, calendar, drive, slack and notion, the grant at the provider is revoked too.
Connected sources are read with POST /v1/context/assemble, which returns ranked context from the person's memory and their connected sources, scoped to that person.
Step by step
- Request Google access for your app in the console if you plan to use gmail, calendar or drive.
- From your server, call the connect route for the provider the person chose.
- Give the person the link. They approve access to their own account.
- Sync the connected account.
- List the person's connected accounts to show what is connected.
- Let the person disconnect an account they no longer want shared.
- Call
POST /v1/context/assemblefor that person to read their connected sources.
What can go wrong
- Gmail, Calendar or Drive will not connect until Google access is approved for your app.
- The person connects their own account by approving the link.
Example: Nadia at Acme
Nadia at Acme wants the Acme pilot assistant to read her calendar. Her user id is demo-user. Your server calls the connect route for the calendar provider, and Nadia approves the link.
After that, your server can read her connected calendar with POST /v1/context/assemble for demo-user. Disconnect is available if she no longer wants the calendar shared.
Frequently asked questions
Can I connect an account for a user without them opening the link?
The person connects their own account by approving a link.
Which accounts can a user connect?
gmail, calendar, drive, notion, slack and email_bridge. Gmail, Calendar and Drive connect once Harny has approved Google access for your app.
What happens when a user disconnects an account?
Your app's access ends. For gmail, calendar, drive, slack and notion, the grant at the provider is revoked too.
Go on. Get Harny.
The first 500 monthly-active end users are free for good. Create an app key and make your first call in minutes.