0.0.7 • Published 2 years ago

@cua.run/client v0.0.7

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

@cua.run/client

cua is your favorite async tasks handler to offload your JavaScript API.

Install

yarn add @cua.run/client

# or

npm i @cua.run/client

Configuration

import cua from "@cua.run/client";

cua.init({ apiToken: "YOUR API TOKEN" });

Usage

Recommended usage

For a seamless integration with your project, we recommend to install our @cua.run/babel babel plugin. Our babel plugin will replace all usage of cua functions to client pushes:

import type { NextApiRequest, NextApiResponse } from "next";
import sentToIntercom from "../../cua-functions/sendToIntercom";

export default function handler(req: NextApiRequest, res: NextApiResponse) {
  const user = { /* ... */ }
  await sentToIntercom(user); // will be replaced by `cua.push('sentToIntercom', [user])` by our babel plugin
  res.status(200).json({ name: "John Doe" });
}

Programmatic usage

await cua.push('function name', args)
0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.4-next.0

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago