You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
Socket
Socket
Sign inDemoInstall

@glazed/datamodel

Package Overview
Dependencies
1
Maintainers
2
Versions
12
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

@glazed/datamodel

Aliases for Ceramic stream references


Version published
Maintainers
2
Created

Readme

Source

Glaze DataModel

Aliases for Ceramic stream references

Documentation

Installation

npm install @glazed/datamodel

Example

import { CeramicClient } from '@ceramicnetwork/http-client'
import { DataModel } from '@glazed/datamodel'

// The model aliases associate human-readable names to Ceramic stream IDs or URLs
const modelAliases = {
  schemas: {
    BlogPost: 'ceramic://<schema URL>',
  },
  definitions: {},
  tiles: {
    examplePost: '<stream ID>',
  },
}

const ceramic = new CeramicClient()
const model = new DataModel({ ceramic, model: modelAliases })

// The model exposes simple APIs over the provided model aliases
const blogPostSchemaURL = model.getSchemaURL('BlogPost')

// Individual tiles defined in the model aliases can be loaded using the alias
const examplePost = await model.loadTile('examplePost')

// New tiles can be created using the defined schema aliases
const newPost = await model.createTile('BlogPost', { title: 'new post', text: 'Hello world' })

Maintainers

  • Paul Le Cam (@paullecam)

License

Dual licensed under MIT and Apache 2

Keywords

FAQs

Package last updated on 21 Jun 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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc