nexora-ide-sdk
v1.0.0
Published
Official SDK for Nexora IDE API — AI, Bookmarks, User and more.
Readme
nexora-sdk
Official Node.js SDK for the Nexora IDE API.
Build AI-powered tools, automate your workflow, and integrate Nexora features directly into your own projects.
Installation
npm install nexora-sdkQuick Start
const { NexoraClient } = require('nexora-sdk');
const nexora = new NexoraClient({ apiKey: 'nxr_live_your_key_here' });
// Test your key
const pong = await nexora.ping();
console.log(pong); // { ok: true, user: 'yourname', remaining: 99 }Or use the shorthand:
const { init } = require('nexora-sdk');
const nexora = init('nxr_live_your_key_here');Get Your API Key
- Open Nexora IDE → Click the 🔑 key icon in the activity bar
- Or go to
https://nexora.app/api-keys - Click Generate Key → copy your
nxr_live_...key
Free Plan: 100 requests/day · Max 3 keys · All features
API Reference
nexora.ping()
Test your API key and check remaining requests.
const result = await nexora.ping();
// { ok: true, message: 'Nexora API is working!', user: 'johndoe', plan: 'free', remaining: 97 }nexora.ai
nexora.ai.chat(messages)
Full AI chat using GPT-style message array. Pass a string for a quick one-liner.
// String shorthand
const reply = await nexora.ai.chat('Write a REST API in Express with JWT auth');
// Full messages array (for conversation history)
const reply = await nexora.ai.chat([
{ role: 'user', content: 'What is a closure in JavaScript?' }
]);
console.log(reply); // Full AI response stringnexora.ai.ask(question, code?)
Quick question with optional code context.
const reply = await nexora.ai.ask('What does this function do?', `
function debounce(fn, delay) {
let timer;
return (...args) => {
clearTimeout(timer);
timer = setTimeout(() => fn(...args), delay);
};
}
`);nexora.ai.review(code, fileName?)
AI code review — returns array of issues.
const issues = await nexora.ai.review(`
var x = 1
console.log(x)
function foo() { return }
`, 'index.js');
issues.forEach(issue => {
console.log(`Line ${issue.line} [${issue.severity}]: ${issue.message}`);
console.log(` Fix: ${issue.fix}`);
});
// [
// { line: 1, severity: 'warning', message: 'Use const/let instead of var', fix: 'const x = 1' },
// ...
// ]nexora.ai.refactor(code, instruction?)
Refactor code with AI. Returns full refactored code string.
const refactored = await nexora.ai.refactor(`
function getData(cb) {
fetch('/api/data', function(err, res) {
cb(err, res);
});
}
`, 'Use async/await instead of callbacks');
console.log(refactored);nexora.bookmarks
nexora.bookmarks.list()
Get all your bookmarks.
const bookmarks = await nexora.bookmarks.list();
bookmarks.forEach(b => {
console.log(`${b.file}:${b.line} — ${b.note}`);
});nexora.bookmarks.add({ file, line?, note? })
Add a new bookmark.
const result = await nexora.bookmarks.add({
file: 'server.js',
line: 42,
note: 'Fix this auth bug later'
});
// { ok: true, bookmark: { id: 'abc123', file: 'server.js', line: 42, ... } }nexora.bookmarks.delete(id)
Delete a bookmark by ID.
await nexora.bookmarks.delete('abc123');
// { ok: true }nexora.user
nexora.user.me()
Get your profile info.
const me = await nexora.user.me();
// {
// username: 'johndoe',
// name: 'John Doe',
// email: '[email protected]',
// avatar: 'https://...',
// plan: 'free',
// usage: { today: 3, total: 47, limit: 100 }
// }nexora.user.usage()
Get daily usage stats.
const usage = await nexora.user.usage();
// {
// plan: 'free',
// reqToday: 3,
// reqTotal: 47,
// limit: 100,
// remaining: 97,
// lastUsed: '2026-04-28T10:30:00.000Z',
// resetsAt: 'midnight UTC daily'
// }Error Handling
const { NexoraClient, NexoraError } = require('nexora-sdk');
const nexora = new NexoraClient({ apiKey: 'nxr_live_...' });
try {
const reply = await nexora.ai.chat('Hello!');
console.log(reply);
} catch (err) {
if (err instanceof NexoraError) {
if (err.status === 429) {
console.log('Rate limit hit! Requests remaining: 0');
} else if (err.status === 401) {
console.log('Invalid API key');
} else {
console.log('API Error:', err.message);
}
}
}TypeScript Support
Full TypeScript definitions included.
import { NexoraClient, NexoraError, ChatMessage, ReviewIssue } from 'nexora-sdk';
const nexora = new NexoraClient({ apiKey: 'nxr_live_...' });
const messages: ChatMessage[] = [
{ role: 'user', content: 'Write a TypeScript interface for a User' }
];
const reply: string = await nexora.ai.chat(messages);All Endpoints
| Method | Endpoint | Description |
|--------|----------|-------------|
| GET | /api/v1/ping | Test key + remaining requests |
| GET | /api/v1/user/me | Your profile info |
| GET | /api/v1/user/usage | Daily usage stats |
| POST | /api/v1/ai/chat | AI chat (messages array) |
| POST | /api/v1/ai/ask | Quick AI question |
| POST | /api/v1/ai/review | Code review → issues array |
| POST | /api/v1/ai/refactor | Refactor code with AI |
| GET | /api/v1/bookmarks | List all bookmarks |
| POST | /api/v1/bookmarks | Add a bookmark |
| DELETE | /api/v1/bookmarks/:id | Delete a bookmark |
All endpoints require the x-nexora-key header.
Rate Limits
| Plan | Requests/day | Keys | |------|-------------|------| | Free | 100 | Max 3 | | Pro | Unlimited (coming soon) | Unlimited |
Limits reset at midnight UTC daily.
License
MIT © 2026 Nexora PVT LTD
