@omneedia/client-js
v2.1.1
Published
Isomorphic Javascript client for Omneedia
Downloads
13
Maintainers
Readme
client-js
An isomorphic JavaScript client for Omneedia.
- Documentation: https://omneedia.com/docs/reference
- TypeDoc: https://supabase.github.io/omneedia/client-js/
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>