@dreesq/serpent-client
v3.0.5
Published
Client component for interacting with serpent
Downloads
70
Readme
Client component of the Serpent ecosystem. You may read more in our documentation.
Setup
npm install @dreesq/serpent-client
Separate dependencies
These dependencies are passed in client constructor
npm i axios socket.io-client
Usage
Basic client instantiation
import Serpent from '@dreesq/serpent-client'
import axios from 'axios';
const client = new Serpent({
debug: true,
axios,
handler: 'https://localhost:3000/o',
actions: 'https://localhost:3000/o'
});
await client.setup();
// Assuming there's an action defined with {name: 'hello'}
const {data, errors} = await client.hello({
name: 'World'
});