New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

para-client-js

Package Overview
Dependencies
Maintainers
1
Versions
74
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

para-client-js

JavaScript Client for Para

latest
Source
npmnpm
Version
1.40.6
Version published
Weekly downloads
44
-65.35%
Maintainers
1
Weekly downloads
 
Created
Source

Logo

JavaScript Client for Para

npm version Join the chat at https://gitter.im/Erudika/para

What is this?

Para was designed as a simple and modular backend framework for object persistence and retrieval. It helps you build applications faster by taking care of the backend. It works on three levels - objects are stored in a NoSQL data store or any old relational database, then automatically indexed by a search engine and finally, cached.

This is the JavaScript client for Para.

Quick start

npm install para-client-js --save

Usage

Initialize the client in your code like so:

import { ParaClient } from 'para-client-js';
var pc = new ParaClient('ACCESS_KEY', 'SECRET_KEY');

If your code runs in a browser environment, you should use a blank secret key and then call signIn():

pc.signIn("password", "{email}::{password}", function(user) {
  // do something with the newly created user
});

It's a bad idea to hardcode your Para secret key in your code because it will run in an insecure client-side environment. Instead use the signIn() method to get an access token (JWT) with limited client permissions. Think of it like this: API key+secret = full API access, paraClient.signIn() = limited API access for clients with JWT tokens. You can have a special user object created just for your JS app and assign it special permissions so that your app can access a part of the Para API before authenticating another real user. Read the documentation for more information about client permissions. For granting resource permissions to your client users go to console.paraio.org where you can edit your app object and allow your users the call specific API methods.

Browser usage

To use para-client-js in the browser run:

npm install
npm run build

This will generate dist/browser/para-client-js.global.iife.js which you can include directly in the browser:

<html>
  <head>
    <script src="dist/browser/para-client-js.global.iife.js"></script>
  </head>
  <body>
    <script>
      var ParaClient = require('para-client-js');
      var pc = new ParaClient('ACCESS_KEY', 'SECRET_KEY');
    </script>
  </body>
</html>

Development

  • npm run build bundles ESM, CommonJS, and browser artifacts into dist/ using tsdown. Types are emitted via npm run types.
  • npm test runs ESLint followed by the fast unit tests in test/unit.
  • Integration tests live under test/integration and require a running Para server. Copy .env.example to .env, adjust PARA_* values, then run npm run test:integration.

Promises and callbacks

All methods return a promise object and also accept a callback function as last parameter. You can choose to either use callbacks or promises. For example:

// using promises
pc.read('user', '1234').then(
  function (user) {
    // do something with user object
  },
  function (err) {
    // request failed
  }
);

// using callbacks
pc.read('user', '1234', function (user, err) {
  // do something with user object
});

Documentation

Read the Docs

Contributing

  • Fork this repository and clone the fork to your machine
  • Create a branch (git checkout -b my-new-feature)
  • Implement a new feature or fix a bug and add some tests
  • Commit your changes (git commit -am 'Added a new feature')
  • Push the branch to your fork on GitHub (git push origin my-new-feature)
  • Create new Pull Request from your fork

For more information see CONTRIBUTING.md

License

Apache 2.0

Keywords

para

FAQs

Package last updated on 26 Mar 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts