nuxt-loops
TypeScript icon, indicating that this package has built-in type declarations

1.1.0 • Public • Published

Loops Nuxt Module

This Nuxt module makes it easy to add the Loops JavaScript SDK to your Nuxt project.

Installation

You can install the package from npm:

npm install nuxt-loops

You will need a Loops API key to use the module.

In your Loops account, go to the API Settings page and click Generate key.

Copy this key and save it in your application code (for example as LOOPS_API_KEY in an .env file).

Then add nuxt-loops to your modules list and add a reference to your API key:

export default defineNuxtConfig({
  modules: ['nuxt-loops'],
  loops: {
    apiKey: process.env.LOOPS_API_KEY
  }
});

Usage

To use the module, import loops from the request context.

Then call one of the SDK methods. Read through the JS SDK docs for more details.

export default defineEventHandler(async (event) => {
  const { loops } = event.context;

  const response = await loops.updateContact("hello@gmail.com", {
    firstName: "Bri",
    lastName: "Chambers",
  })
});

See the API documentation to learn more about rate limiting and error handling.

Readme

Keywords

none

Package Sidebar

Install

npm i nuxt-loops

Weekly Downloads

2

Version

1.1.0

License

MIT

Unpacked Size

5.22 kB

Total Files

12

Last publish

Collaborators

  • danrowden