JSPM

@omneedia/client-js

2.1.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 9
  • Score
    100M100P100Q30847F
  • License MIT

Isomorphic Javascript client for Omneedia

Package Exports

  • @omneedia/client-js
  • @omneedia/client-js/dist/main/index.js
  • @omneedia/client-js/dist/module/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@omneedia/client-js) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

client-js

An isomorphic JavaScript client for Omneedia.

Usage

First of all, you need to install the library:

npm install @omneedia/client-js

Then you're able to import the library and establish the connection with the database:

import { createClient } from '@omneedia/client-js'

// Create a single omneedia client for interacting with your database
const supabase = createClient('https://xyzcompany.supabase.co', 'public-anon-key')

UMD

You can now use plain <script>s to import client-js from CDNs, like:

<script src="https://cdn.jsdelivr.net/npm/@omneedia/client-js"></script>

or even:

<script src="https://unpkg.com/@omneedia/client-js"></script>

Then you can use it from a global omneedia variable:

<script>
  const { createClient } = omneedia
  const _omneedia = createClient('https://xyzcompany.supabase.co', 'public-anon-key')

  console.log('Omneedia Instance: ', _omneedia)
  // ...
</script>

ESM

You can now use type="module" <script>s to import client-js from CDNs, like:

<script type="module">
  import { createClient } from 'https://cdn.jsdelivr.net/npm/@omneedia/client-js/+esm'
  const supabase = createClient('https://xyzcompany.supabase.co', 'public-anon-key')

  console.log('Omneedia Instance: ', omneedia)
  // ...
</script>