Documentation Index Fetch the complete documentation index at: https://docs.aikocorp.ai/llms.txt
Use this file to discover all available pages before exploring further.
Prerequisites
An AIKO project with your project key and secret key
A web application using one of our supported frameworks:
Next.js
Express
FastAPI
Flask
Actix Web
Your framework is missing? Let us know what we should add next!
Where to find your project key and secret key
If you missed copying your keys from the onboarding step when creating a project, you can find them again in Settings → Projects : Your browser does not support the video tag.
Quick Setup with Wizard
The fastest way to get started is with our setup wizard—it handles authentication, project setup, and configuration in one go. Just run this from your project root:
Once setup is complete, you will need to send a test request to your API and wait about 30 seconds for events to show up in the dashboard.
Grouping apps in one project
If you have multiple customer-facing products, it’s best to install AIKO Monitor on them all and group them in one project. This makes it possible to track users across their entire journey (e.g. from visiting your landing page to signing up for your product).
Manual Installation
If you’d prefer manual steps (or if the wizard doesn’t fit your setup), you can follow the steps below for your framework.
Next.js
Express
FastAPI
Flask
Actix Web
Install the package
Install AIKO Monitor via npm:
Create .env file
Create a .env file in your project root with your AIKO credentials: # .env
AIKO_PROJECT_KEY = "<project_key>"
AIKO_SECRET_KEY = "<secret_key>"
Initialize in your app
Create an instrumentation.ts file in your project root and initialize AIKO Monitor: // instrumentation.ts
export async function register () {
if ( process . env . NEXT_RUNTIME === "nodejs" ) {
const aiko = await import ( "aiko-monitor" );
const monitor = aiko . default . init ({
projectKey: process . env . AIKO_PROJECT_KEY ,
secretKey: process . env . AIKO_SECRET_KEY ,
});
monitor . instrumentNextJs ();
}
}
Then create your API routes as usual: // app/api/users/route.ts
export async function GET () {
const users = [{ id: 1 , name: "John Doe" }];
return Response . json ({ users });
}
Install the package
Install AIKO Monitor via npm:
Create .env file
Create a .env file in your project root with your AIKO credentials: # .env
AIKO_PROJECT_KEY = "<project_key>"
AIKO_SECRET_KEY = "<secret_key>"
Initialize in your app
Import and initialize AIKO Monitor in your Express application. The monitor middleware must be the first middleware: // server.js
import dotenv from "dotenv" ;
dotenv . config ();
import express from "express" ;
import aiko from "aiko-monitor" ;
const app = express ();
const monitor = aiko . init ({
projectKey: process . env . AIKO_PROJECT_KEY ,
secretKey: process . env . AIKO_SECRET_KEY ,
});
app . use ( monitor . middleware ()); // must be the first middleware
app . use ( express . json ());
app . get ( "/api/users" , ( req , res ) => {
res . json ({ users: [{ id: 1 , name: "John Doe" }] });
});
app . listen ( 3000 );
Install the package
Install AIKO Monitor via pip:
Create .env file
Create a .env file in your project root with your AIKO credentials: # .env
AIKO_PROJECT_KEY = "<project_key>"
AIKO_SECRET_KEY = "<secret_key>"
Initialize in your app
Import and initialize AIKO Monitor in your FastAPI application: # main.py
import os
from dotenv import load_dotenv
from fastapi import FastAPI
from aiko_monitor import Monitor
load_dotenv()
app = FastAPI()
Monitor(
app,
project_key = os.getenv( "AIKO_PROJECT_KEY" ),
secret_key = os.getenv( "AIKO_SECRET_KEY" ),
)
@app.get ( "/api/users" )
def get_users ():
return { "users" : []}
Install the package
Install AIKO Monitor via pip:
Create .env file
Create a .env file in your project root with your AIKO credentials: # .env
AIKO_PROJECT_KEY = "<project_key>"
AIKO_SECRET_KEY = "<secret_key>"
Initialize in your app
Import and initialize AIKO Monitor in your Flask application: # app.py
import os
from dotenv import load_dotenv
from flask import Flask
from aiko_monitor import Monitor
load_dotenv()
app = Flask( __name__ )
Monitor(
app,
project_key = os.getenv( "AIKO_PROJECT_KEY" ),
secret_key = os.getenv( "AIKO_SECRET_KEY" ),
)
@app.route ( "/api/users" )
def get_users ():
return { "users" : []}
Install the package
Add AIKO Monitor to your Cargo.toml with the required features: cargo add aiko-monitor --features actix
Or add this to your Cargo.toml: [ dependencies ]
aiko-monitor = { version = "0.0.1" , features = [ "actix" ] }
Create .env file
Create a .env file in your project root with your AIKO credentials: # .env
AIKO_PROJECT_KEY = "<project_key>"
AIKO_SECRET_KEY = "<secret_key>"
Initialize in your app
Import and wrap your Actix Web application with the AIKO Monitor middleware: // src/main.rs
use std :: env;
use std :: io :: Result as IoResult ;
use actix_web :: middleware :: Logger ;
use actix_web :: { App , HttpResponse , HttpServer , Responder , web};
use aiko_monitor :: { Monitor , integrations :: actix :: MonitorActix };
use dotenvy :: dotenv;
async fn get_users () -> impl Responder {
HttpResponse :: Ok ()
. content_type ( "application/json" )
. body ( r#"{"users": []}"# )
}
#[actix_web :: main]
async fn main () -> IoResult <()> {
dotenv () . ok ();
let monitor = Monitor :: new (
env :: var ( "AIKO_PROJECT_KEY" ) . expect ( "AIKO_PROJECT_KEY must be set" ),
env :: var ( "AIKO_SECRET_KEY" ) . expect ( "AIKO_SECRET_KEY must be set" ),
)
. expect ( "valid monitor configuration" );
HttpServer :: new ( move || {
let monitor = monitor . clone ();
App :: new ()
. wrap ( Logger :: default ())
. wrap ( MonitorActix :: new ( monitor ))
. route ( "/api/users" , web :: get () . to ( get_users ))
})
. bind (( "127.0.0.1" , 3000 )) ?
. run ()
. await
}
Next steps
Monitor Features Learn about all monitoring capabilities