A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://developers.notion.com/docs/best-practices-for-handling-api-keys below:

Best Practices for Handling API Keys

API keys are powerful credentials that provide access to your Notion workspace through our Public API. If these keys fall into the wrong hands, they can pose serious security risks to your integrations, data and workspace.

When your Notion API key is exposed, malicious actors could potentially:

The scope of access depends on the permissions granted to the integration that owns the API key, but even limited access can be dangerous in the wrong hands.

Never hardcode API keys directly in your source code. Instead, use environment variables:

# .env file (never commit this file)
NOTION_API_KEY=ntn_abc123def456ghi789jkl012mno345pqr
// In your code
const notion = new Client({
  auth: process.env.NOTION_API_KEY,
});

Use tools like GitLeaks, Detect Secrets, or Trufflehog to automatically detect and prevent the commitment of sensitive information like API keys to your repositories. These tools can:

If you suspect that your API key may be compromised, we recommend taking action immediately:

  1. Log into your Notion account
  2. Go to Settings & membersConnectionsDevelop or manage integrations
  3. Find the integration with the compromised key
  4. Click “Refresh” on your integration

Rotate the compromised key by clicking Refresh in your integrations page at https://www.notion.so/profile/integrations update your applications with your new key.

Click Refresh to rotate the API key for a new one

  1. Check your workspace for any suspicious activity
  2. Review recent changes to pages and databases
  3. Look for any unauthorized integrations in Settings & membersConnections

If you need assistance with API key security or suspect unauthorized access, contact Notion support at [email protected]

Updated 5 days ago


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4