Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@wireapp/api-client

Package Overview
Dependencies
Maintainers
0
Versions
1429
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@wireapp/api-client

Wire API Client to send and receive data.

  • 27.17.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
452
decreased by-79.21%
Maintainers
0
Weekly downloads
 
Created
Source

Wire

This repository is part of the source code of Wire. You can find more information at wire.com or by contacting opensource@wire.com.

You can find the published source code at github.com/wireapp.

For licensing information, see the attached LICENSE file and the list of third-party licenses at wire.com/legal/licenses/.

API Client

Wire for Web's API client.

Getting Started

yarn
yarn start

Installation

yarn add @wireapp/api-client

Usage

Wire Backend
import {APIClient} from '@wireapp/api-client';
import {LoginData} from '@wireapp/api-client/lib/auth/';
import {ClientType} from '@wireapp/api-client/lib/client';

const credentials: LoginData = {
  clientType: ClientType.TEMPORARY,
  email: 'user@wire.com',
  password: 'top-secret',
};

const apiClient = new APIClient();

apiClient.login(credentials);
Custom Backend
import {APIClient} from '@wireapp/api-client';
import {Config} from '@wireapp/api-client/lib/Config';
import {LoginData} from '@wireapp/api-client/lib/auth/';
import {ClientType} from '@wireapp/api-client/lib/client';

const credentials: LoginData = {
  clientType: ClientType.TEMPORARY,
  email: 'user@wire.com',
  password: 'top-secret',
};

const apiConfig: Config = {
  urls: {
    name: 'My custom backend',
    rest: 'https://backend-rest.domain.com',
    ws: 'wss://backend-websocket.domain.com',
  },
};

const apiClient = new APIClient(apiConfig);

apiClient.login(credentials);

Examples

Browser

Node.js

Execution

Bash

#!/bin/bash

EMAIL="name@email.com"
PASSWORD="password"

node index.js --e="$EMAIL" --p="$PASSWORD"

Node

npm run dist
node index.js --e="name@email.com" --p="password"

FAQs

Package last updated on 16 Dec 2024

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc