@volcano.dev/sdk
v1.2.1
Published
Official JavaScript SDK for Volcano - Authentication, Database, Functions, Realtime, and more
Maintainers
Readme
Volcano SDK
The official JavaScript/TypeScript SDK for Volcano.
Installation
npm install @volcano.dev/sdkQuick Start
import { VolcanoAuth } from '@volcano.dev/sdk';
const volcano = new VolcanoAuth({
apiUrl: 'https://api.yourproject.volcano.dev',
anonKey: 'your-anon-key',
});
// Authentication
const { user } = await volcano.auth.signIn({
email: '[email protected]',
password: 'password123',
});
// Database queries
volcano.database('my-database');
const { data } = await volcano
.from('posts')
.select('*')
.eq('published', true)
.order('created_at', { ascending: false });
// File storage
const { data: file } = await volcano.storage.from('uploads').upload('photo.jpg', imageFile);
// Realtime subscriptions
import { VolcanoRealtime } from '@volcano.dev/sdk/realtime';
const realtime = new VolcanoRealtime({
apiUrl: 'https://api.yourproject.volcano.dev',
anonKey: 'your-anon-key',
accessToken: volcano.accessToken,
});
await realtime.connect();
const channel = realtime.channel('updates', { type: 'postgres' });
channel.onPostgresChanges('INSERT', 'public', 'posts', (change) => {
console.log('New post:', change.record);
});
await channel.subscribe();For browser realtime connections, make sure the browser app's origin is allowed in your project's auth CORS settings. The anonymous key is used to identify the project before the WebSocket upgrade completes.
Documentation
| Guide | Description | | -------------------------------------------- | --------------------------------- | | Getting Started | Installation and setup | | Authentication | Sign-up, sign-in, OAuth, sessions | | Database | Query builder and CRUD operations | | Storage | File upload and management | | Realtime | Live subscriptions and presence | | Functions | Serverless function invocation | | Next.js | Server components and middleware | | TypeScript | Type definitions | | Error Handling | Error patterns |
Contributing
See CONTRIBUTING.md for local workflows, package structure, and pull request expectations.
If you believe you have found a security vulnerability, do not open a public issue. Follow SECURITY.md instead.
License
Volcano SDK is licensed under the Apache License 2.0. See LICENSE.
