@nuvix/console
TypeScript icon, indicating that this package has built-in type declarations

0.0.5-alpha.2 • Public • Published

Nuvix Console SDK

The Nuvix Console SDK provides developers with a convenient way to interact with the Nuvix backend, designed for managing projects, organizations, and related resources. This SDK is fully compatible with Nuvix server version 1.0.x. For compatibility with older server versions, refer to the release notes.


Features

  • Manage Accounts and Users.
  • Operate on Projects, Organizations, and Teams.
  • Utilize Databases, Functions, Storage, and Backups.
  • Handle real-time updates with RealtimeResponseEvent.
  • Comprehensive support for Messaging, Health Checks, GraphQL, and Locale services.
  • Authentication and OAuth support via enums like AuthenticatorType and OAuthProvider.
  • Simplified management of roles, permissions, and configurations.

Installation

Install the SDK via npm:

npm install @nuvix/console

Or using Yarn:

yarn add @nuvix/console

Getting Started

Initializing the Client

import { Client } from '@nuvix/console';

const client = new Client();
    .setEndpoint('https://api.nuvix.com/v1')  // API endpoint
    .setEndpointRealtime('https://api.nuvix.com/v1/realtime')  // Realtime API endpoint
    .setLocale('en-US')  // Locale setting (optional)

Example: Managing Accounts

import { Account } from '@nuvix/console';

const accountService = new Account(client);

// Create a new account
accountService.create({
  email: 'user@example.com',
  password: 'securepassword',
});

// Retrieve account details
const accountDetails = await accountService.get();
console.log(accountDetails);

Example: Real-Time Subscriptions

import { RealtimeResponseEvent } from '@nuvix/console';

client.subscribe('projects', (event: RealtimeResponseEvent) => {
  console.log('Realtime event:', event);
});

Services

The SDK includes services for interacting with various Nuvix resources:

  • Account: Manage user accounts.
  • Avatars: Handle user avatars.
  • Backups: Manage database backups.
  • Databases: Operate on databases and collections.
  • Functions: Deploy and execute serverless functions.
  • Organizations: Manage organizations and their members.
  • Projects: Create and manage projects.
  • Storage: Handle file uploads and downloads.
  • Teams: Manage team memberships and permissions.
  • Users: Operate on users within the platform.

For a full list of services, refer to the API documentation.


Advanced Usage

Enums

The SDK provides a rich set of enums for standardizing interactions:

  • AuthenticatorType: Authentication mechanisms.
  • OAuthProvider: Supported OAuth providers.
  • Region: Available regions for resource deployment.
  • And many more.

Types

Type safety is provided through:

  • Models
  • Payload
  • RealtimeResponseEvent
  • UploadProgress

Permissions and Roles

Use the Permission and Role classes to manage user and team permissions.


Contributing

Contributions are welcome! Please read our Contributing Guide for guidelines.


License

This SDK is licensed under the BSD 3-Clause License. See the LICENSE file for details.


Support

If you encounter any issues, feel free to open an issue or contact us at support@nuvix.com.


Readme

Keywords

Package Sidebar

Install

npm i @nuvix/console

Weekly Downloads

3

Version

0.0.5-alpha.2

License

BSD-3-Clause

Unpacked Size

6.33 MB

Total Files

146

Last publish

Collaborators

  • ravikan6