Sentry
The Sentry enables tools and to call the Sentry API on behalf of a .
What’s documented here
This page describes how to use and configure Sentry auth with Arcade.
This is used by:
- Your app code that needs to call the Sentry API
- Or, your custom tools that need to call the Sentry API
Configuring Sentry auth
When using your own app credentials, make sure you configure your to use a custom user verifier. Without this, your end-users will not be able to use your app or in production.
In a production environment, you will most likely want to use your own Sentry app credentials. This way, your will see your application’s name requesting permission.
Before showing how to configure your Sentry app credentials, let’s go through the steps to create a Sentry OAuth application.
Create a Sentry OAuth application
- Sign in to Sentry and open Settings → Account → API → Applications .
- Click Create New Application.
- Give the application a name.
- Add the Authorized Redirect URI generated by Arcade (see below).
- Save the application, then copy its Client ID and Client Secret.
Sentry requests scopes at authorization time rather than on the application itself. Choose the scopes your app or need when you call auth.start() (see the examples below). Common read scopes include:
org:readproject:readteam:readmember:readevent:read
See Sentry’s permissions and scopes reference for the full list.
Next, add the Sentry app to Arcade.
Configuring your own Sentry Auth Provider in Arcade
Dashboard GUI
Configure Sentry Auth Using the Arcade Dashboard GUI
Access the Arcade Dashboard
To access the Arcade Cloud dashboard, go to api.arcade.dev/dashboard . If you are self-hosting, by default the dashboard will be available at http://localhost:9099/dashboard . Adjust the host and port number to match your environment.
Navigate to the OAuth Providers page
- Under the Connections section of the Arcade Dashboard left-side menu, click Connected Apps.
- Click Add OAuth Provider in the top right corner.
- Select the Included Providers tab at the top.
- In the Provider dropdown, select Sentry.
Enter the provider details
- Choose a unique ID for your provider (e.g. “my-sentry-provider”).
- Optionally enter a Description.
- Enter the Client ID and Client Secret from your Sentry application.
- Note the Redirect URL generated by Arcade. This must be added to your Sentry application’s Authorized Redirect URIs.
Create the provider
Hit the Create button and the provider will be ready to be used.
When you use tools that require Sentry auth using your Arcade credentials, Arcade will automatically use this Sentry OAuth provider. If you have multiple Sentry providers, see using multiple auth providers of the same type for more information.
Using Sentry auth in app code
Use the Sentry in your own and AI apps to get a token for the Sentry API. See authorizing agents with Arcade to understand how this works.
Use client.auth.start() to get a token for the Sentry API:
Python
from arcadepy import Arcade
client = Arcade() # Automatically finds the `ARCADE_API_KEY` env variable
user_id = "{arcade_user_id}"
# Start the authorization process
auth_response = client.auth.start(
user_id=user_id,
provider="sentry",
scopes=["org:read", "project:read"],
)
if auth_response.status != "completed":
print("Please complete the authorization challenge in your browser:")
print(auth_response.url)
# Wait for the authorization to complete
auth_response = client.auth.wait_for_completion(auth_response)
token = auth_response.context.token
# Do something interesting with the token...Using Sentry auth in custom tools
You can author your own custom tools that interact with the Sentry API.
Use the Sentry() auth class to specify that a requires authorization with Sentry. The context.authorization.token field will be automatically populated with the ’s Sentry token:
from typing import Annotated
import httpx
from arcade_tdk import ToolContext, tool
from arcade_tdk.auth import Sentry
@tool(
requires_auth=Sentry(
scopes=["org:read"],
)
)
async def list_organizations(
context: ToolContext,
) -> Annotated[list[dict], "The organizations the user can access"]:
"""List the Sentry organizations the authorized user belongs to."""
url = "https://sentry.io/api/0/organizations/"
headers = {"Authorization": f"Bearer {context.authorization.token}"}
async with httpx.AsyncClient() as client:
response = await client.get(url, headers=headers)
response.raise_for_status()
return response.json()