New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@spacetimexyz/client

Package Overview
Dependencies
Maintainers
2
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@spacetimexyz/client

Client (browser/node) for Spacetime

latest
npmnpm
Version
0.2.4
Version published
Weekly downloads
18
Maintainers
2
Weekly downloads
 
Created
Source

Spacetime Client (Browser/Node)

A client to connect to the Spacetime decentralized database.

Install Spacetime

npm install @spacetimexyz/spacetime
yarn add @spacetimexyz/spacetime

Initialize the SDK

import Spacetime from '@spacetimexyz/spacetime'

const db = new Spacetime({
  ...config
})

Get a single record

You can read data once, by calling the .doc(id: string).get() method on a collection.

const colRef = db.collection("org/places")
const record = await colRef.doc("id").get()

const { id, ...data } = record

Write data

const colRef = db.collection("org/places")
const doc = await colRef.doc("london").set({
  name: "London",
  country: "UK",
})

Tests

To run E2E tests, ensure that Spacetime is running, and then run:

yarn test:e2e

FAQs

Package last updated on 07 Oct 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts