Skip to content

Client library for Serpent containing plugins for actions, authentication, validation and communication with the server component

License

Notifications You must be signed in to change notification settings

dreesq/serpent-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

197 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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'
});

About

Client library for Serpent containing plugins for actions, authentication, validation and communication with the server component

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •