Git Product home page Git Product logo

koji-database-sdk's Introduction

Koji Database (deprecated)

npm (scoped)

SDK for communicating between a Koji template and its in-built database service.

Overview

The @withkoji/database package enables you to implement a Koji database for the backend of your template. A Koji database is a key-value store that is included with each project on Koji.

[DEPRECATED] This package is deprecated and is included only for backwards compatibility. For new templates, use @withkoji/core.

Installation

Install the package in the backend service of your Koji project.

npm install --save @withkoji/database

NOTE: To support instant remixes of your template, you must also install the @withkoji/vcc package and implement the VccMiddleware on your backend server. This middleware maintains the environment variables for instant remixes, ensuring that database access is restricted to the correct remix version.

Basic use

Import and instantiate the database SDK in the backend service.

import Database from '@withkoji/Database';
const database = new Database({
  projectId: res.locals.KOJI_PROJECT_ID,
  projectToken: res.locals.KOJI_PROJECT_TOKEN,
});

Set database entries in the database using the SDK.

const isAdded = await database.set('myCollection', 'myKey', {'myValue':1});

Get database entries from the database using the SDK.

const myEntry = await database.get('myCollection','myKey');

Related resources

Contributions and questions

See the contributions page on the developer site for info on how to make contributions to Koji repositories and developer documentation.

For any questions, reach out to the developer community or the @Koji Team on our Discord server.

koji-database-sdk's People

Contributors

arist0tl3 avatar charuwts avatar jameshole avatar rasienko avatar sthielen avatar trobinson41 avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.