Adamite
  • Initial page
  • Server
    • Introduction
    • Database
      • Configuration
      • Using different adapters
        • Memory Adapter
      • Securing your data
        • Securing read operations
    • Functions
      • Invokable Functions
      • Runtime Functions
      • Scheduled Functions
  • SDK
    • Introduction
    • Database
      • Introduction
      • Read a document
      • Read multiple documents
      • Subscribe to changes
      • Create a new document
      • Update an existing document
      • Delete a document
    • Authentication
      • Create a user
      • Log in and log out
      • Get the logged in user
    • Functions
      • Invoke a function
Powered by GitBook
On this page
  • Install the SDK
  • Initialize the SDK

Was this helpful?

  1. SDK

Introduction

Use the Adamite SDK to connect to your Adamite server.

Install the SDK

yarn add @adamite/sdk

Initialize the SDK

import adamite, {
  AuthPlugin,
  DatabasePlugin,
  FunctionsPlugin,
} from "@adamite/sdk";

adamite()
  .use(AuthPlugin)
  .use(DatabasePlugin)
  .use(FunctionsPlugin)
  .initializeApp({
    url: "http://localhost:9000",
    apiKey: "your_api_key",
  });

Once everything is configured properly, you'll be able to see these lines logged in your client's console...

⚡ [grid.auth]	connected
⚡ [grid.functions] connected
⚡ [grid.database] connected
PreviousScheduled FunctionsNextDatabase

Last updated 5 years ago

Was this helpful?