Skip to main content

Authentication

To use the Inceptron API, you need an API key. This key is your secret credential for accessing our services. This guide will show you how to find your key and use it securely.

Finding Your API Key

You can find your API key in your Inceptron account dashboard under the "API Keys" section. Your key is a secret, and you should treat it like a password.

Securing Your API Key

It is crucial to keep your API key secure to prevent unauthorized access to your account. Here are some best practices:

Use Environment Variables

The most secure way to use your API key in an application is to store it in an environment variable. This avoids hardcoding the key in your source code.

Create a file named .env in your project's root directory (and make sure to add .env to your .gitignore file to prevent it from being committed).

INCEPTRON_API_KEY="your_api_key_here"

You can then load this variable in your application.

Python

You'll need a library like python-dotenv to load the .env file.

pip install python-dotenv

Then, in your code:

import os
from dotenv import load_dotenv

load_dotenv() # Loads variables from .env file

api_key = os.getenv("INCEPTRON_API_KEY")

# Now you can use the api_key with the client

JavaScript (Node.js)

You can use the dotenv package.

npm install dotenv

Then, in your code:

require('dotenv').config();

const apiKey = process.env.INCEPTRON_API_KEY;

// Now you can use the apiKey with the client

Never Expose Keys on the Client-Side

Never use your secret API key in client-side code (like a React or Vue.js application that runs in the browser). If you do, anyone can find your key and use your account. If you need to call the Inceptron API from the frontend, create a backend proxy that securely stores your key and forwards requests.

Gitignore Your Keys

Ensure that your API keys or .env files are never committed to version control (like Git). Add your .env file and any other sensitive configuration files to your .gitignore file.

# .gitignore

.env