1.0.3 β€’ Published 1 year ago

@lambahq/nuxt v1.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Lamba

npm version npm downloads License

Integrate the Lamba client library in your nuxt project to start using low code capabilities in your web apps.

Previews

Features

  • β›° Β Embed low code capabilities
  • 🚠 Β Same configuration & doc as the CDN version
  • 🌲 Β Enjoy light and dark theme
  • πŸ‘©β€πŸŽ¨ Β Responsive & mobile friendly UI

Quick Setup

  1. Add @lambahq/nuxt dependency to your project
# Using pnpm
pnpm add @lambahq/nuxt

# Using yarn
yarn add @lambahq/nuxt

# Using npm
npm install @lambahq/nuxt
  1. Add @lambahq/nuxt to the modules section of nuxt.config.ts and setup the runtimeConfig as shown below:
export default defineNuxtConfig({
  ssr: true, // "true" or "false". Works eitherway regardless. i.e Lamba is SSR friendly!
  modules: [
    '@lambahq/nuxt'
  ]
})

Usage

import { useNuxtApp } from '#app';
const nuxtApp = useNuxtApp();

const openLamba = ()=>{
  const config = {
    title: "Lamba",
    theme: "light",
    appId: "65aabeba6182d6903a2ea355",
    customerId: "cus_x1847",
  };

  const lamba = nuxtApp.$lamba(config);

  // listening for events
  lamba.on("name_of_the_event",(data)=>{
    console.log(data);
  })
}

Using Up To Date Versions

To always use the updated versions of the library, set the alwaysUseUpToDateVersions property to true in the nuxt.config.js file of your project like so:

export default defineNuxtConfig({
  runtimeConfig: {
    public: {
      lamba: {
        alwaysUseUpToDateVersions: true
      }
    }
  }
})

That's it! You can now use Lamba in your Nuxt app ✨