@omneedia/client-js
TypeScript icon, indicating that this package has built-in type declarations

2.1.1 • Public • Published

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>

Package Sidebar

Install

npm i @omneedia/client-js

Weekly Downloads

2

Version

2.1.1

License

MIT

Unpacked Size

516 kB

Total Files

195

Last publish

Collaborators

  • stephane.zucatti