2.1.5 • Published 4 months ago

cubid-sdk v2.1.5

Weekly downloads
-
License
ISC
Repository
github
Last release
4 months ago

Cubid SDK

Cubid SDK provides a simple interface for interacting with the Cubid API to manage identity, location, and score data for users, and to securely store secrets. The SDK is designed for easy integration into dApps or web applications that require identity management using the Cubid Protocol.

Features

  • User Identity Management: Fetch and manage user identity data.
  • Location Data: Retrieve approximate, rough, or exact location data for a user.
  • User Score: Fetch the trust score of a user.
  • User Creation: Create new users with email and phone number.
  • Secret Storage: Save and manage secrets for users.

Installation

You can install the SDK via npm:

npm install cubid-sdk

For more information, visit the npm package page.

API Keys

Use Cubid's Admin Console to configure your App and get provisioned with a dApp ID and API Keys.

Usage

Here's an example of how to use the Cubid SDK:

Initialization

const CubidSDK = require('cubid-sdk');

// Initialize with your dapp_id and api_key
const cubid = new CubidSDK('your_dapp_id', 'your_api_key');

API Methods (examples, non-exhaustive list)

1. Create a New User

cubid.createUser({ email: 'user@example.com', phone: '1234567890' })
  .then(response => console.log('New user created:', response))
  .catch(error => console.error('Error creating user:', error));

2. Fetch Identity Data

cubid.fetchIdentity({ user_id: 'user123' })
  .then(response => console.log('Identity data:', response))
  .catch(error => console.error('Error fetching identity:', error));

3. Fetch User Location (Exact)

cubid.fetchExactLocation({ user_id: 'user123' })
  .then(response => console.log('Exact location data:', response))
  .catch(error => console.error('Error fetching location:', error));

4. Fetch User Location (Approximate)

cubid.fetchApproxLocation({ user_id: 'user123' })
  .then(response => console.log('Approximate location data:', response))
  .catch(error => console.error('Error fetching approximate location:', error));

5. Fetch Rough Location (Rough)

cubid.fetchRoughLocation({ user_id: 'user123' })
  .then(response => console.log('Rough location data:', response))
  .catch(error => console.error('Error fetching rough location:', error));

6. Fetch User Data

cubid.fetchUserData({ user_id: 'user123' })
  .then(response => console.log('User data:', response))
  .catch(error => console.error('Error fetching user data:', error));

7. Fetch Score

cubid.fetchScore({ user_id: 'user123' })
  .then(response => console.log('Score data:', response))
  .catch(error => console.error('Error fetching score:', error));

8. Save Secret for a User

cubid.saveSecret({ user_id: 'user123', secret: 'mySuperSecretKey' })
  .then(response => console.log('Secret saved:', response))
  .catch(error => console.error('Error saving secret:', error));

API Reference

For more detailed information about the API endpoints and parameters, check the Cubid API Documentation.

Full Source Code

You can view the full source code for this SDK here.

License

This project is licensed under the MIT License. See the LICENSE file for details.

2.1.5

4 months ago

2.1.4

5 months ago

2.0.3

5 months ago

2.0.5

5 months ago

2.0.4

5 months ago

2.0.7

5 months ago

2.0.6

5 months ago

2.0.9

5 months ago

2.0.1

5 months ago

2.0.0

5 months ago

1.9.1

5 months ago

1.9.0

5 months ago

1.9.9

5 months ago

1.9.8

5 months ago

1.9.7

5 months ago

1.9.6

5 months ago

1.9.5

5 months ago

1.9.4

5 months ago

1.9.3

5 months ago

1.9.2

5 months ago

2.1.2

5 months ago

2.1.1

5 months ago

2.1.3

5 months ago

2.1.0

5 months ago

1.8.9

5 months ago

1.8.8

5 months ago

1.8.7

5 months ago

1.7.9

5 months ago

1.7.8

5 months ago

1.7.7

5 months ago

1.7.5

5 months ago

1.7.4

5 months ago

1.6.9

5 months ago

1.6.8

5 months ago

1.6.7

6 months ago

1.8.2

5 months ago

1.8.1

5 months ago

1.8.0

5 months ago

1.7.3

5 months ago

1.7.2

5 months ago

1.7.1

5 months ago

1.7.0

5 months ago

1.8.6

5 months ago

1.8.5

5 months ago

1.8.4

5 months ago

1.8.3

5 months ago

1.6.4

6 months ago

1.6.3

6 months ago

1.6.1

6 months ago

1.6.0

6 months ago

1.5.5

6 months ago

1.6.6

6 months ago

1.6.5

6 months ago

1.6.34

6 months ago

1.5.9

6 months ago

1.5.8

6 months ago

1.5.7

6 months ago

1.5.6

6 months ago

1.5.4

6 months ago

1.5.3

6 months ago

1.5.2

6 months ago

1.5.1

6 months ago

1.5.0

6 months ago

1.4.6

6 months ago

1.4.5

6 months ago

1.4.4

6 months ago

1.4.2

6 months ago

1.4.1

6 months ago

1.4.0

6 months ago

1.3.3

6 months ago

1.3.2

6 months ago

1.3.1

6 months ago

1.4.9

6 months ago

1.4.8

6 months ago

1.4.7

6 months ago

1.2.7

6 months ago

1.2.6

6 months ago

1.3.0

6 months ago

1.2.5

7 months ago

1.2.4

7 months ago

1.2.3

7 months ago

1.2.0

7 months ago

1.2.2

7 months ago

1.2.1

7 months ago

1.1.19

7 months ago

1.1.18

7 months ago

1.1.16

8 months ago

1.1.15

8 months ago

1.1.14

8 months ago

1.1.17

8 months ago

1.1.13

8 months ago

1.0.62

8 months ago

1.0.61

8 months ago

1.0.60

8 months ago

1.0.66

8 months ago

1.0.65

8 months ago

1.0.63

8 months ago

1.0.26

8 months ago

1.0.69

8 months ago

1.0.25

8 months ago

1.0.24

8 months ago

1.0.67

8 months ago

1.0.29

8 months ago

1.0.28

8 months ago

1.0.27

8 months ago

1.0.73

8 months ago

1.0.72

8 months ago

1.0.70

8 months ago

1.0.33

8 months ago

1.0.76

8 months ago

1.0.32

8 months ago

1.0.75

8 months ago

1.0.31

8 months ago

1.0.74

8 months ago

1.0.30

8 months ago

1.0.37

8 months ago

1.0.36

8 months ago

1.0.35

8 months ago

1.1.1

8 months ago

1.1.0

8 months ago

1.0.39

8 months ago

1.0.38

8 months ago

1.1.9

8 months ago

1.1.6

8 months ago

1.1.5

8 months ago

1.1.4

8 months ago

1.1.3

8 months ago

1.1.2

8 months ago

1.0.40

8 months ago

1.0.44

8 months ago

1.0.43

8 months ago

1.1.10

8 months ago

1.0.42

8 months ago

1.0.41

8 months ago

1.0.48

8 months ago

1.0.46

8 months ago

1.0.45

8 months ago

1.0.49

8 months ago

1.0.51

8 months ago

1.0.50

8 months ago

1.0.55

8 months ago

1.0.54

8 months ago

1.0.53

8 months ago

1.0.52

8 months ago

1.0.59

8 months ago

1.0.58

8 months ago

1.0.57

8 months ago

1.0.56

8 months ago

1.0.22

8 months ago

1.0.21

8 months ago

1.0.23

8 months ago

1.0.19

9 months ago

1.0.18

9 months ago

1.0.17

9 months ago

1.0.16

9 months ago

1.0.9

9 months ago

1.0.8

9 months ago

1.0.7

9 months ago

1.0.6

9 months ago

1.0.5

9 months ago

1.0.4

9 months ago

1.0.3

9 months ago

1.0.11

9 months ago

1.0.10

9 months ago

1.0.20

9 months ago

1.0.15

9 months ago

1.0.14

9 months ago

1.0.13

9 months ago

1.0.12

9 months ago

1.0.2

9 months ago

1.0.1

9 months ago

1.0.0

9 months ago