Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

@tolgee/socketio-client

Package Overview
Dependencies
Maintainers
2
Versions
105
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

@tolgee/socketio-client

Client library for Tolgee Socket.io server

unpublished
latest
Source
npmnpm
Version
4.7.4-rc.1a63ba95.0
Version published
Maintainers
2
Created
Source

Socket IO client for Tolgee Server

Tolgee

Simple client for Socket.io server embedded in Tolgee server to listen for data modification events live.

Usage

import {TranslationsClient} from "@tolgee/socketio-client";

const client = new TranslationsClient({
  authentication: {
    apiKey: 'your_cool_api_key',
  },
});

client.on('connect', () => {
  console.log('Yep! You\'re connected!');
});

client.on('translation_modified', (data) => {
  console.log(data);
})

Console output:

Yep! You\'re connected!
{
  id: 1000001001,
  text: 'Noice! This text was changed!',
  state: 'TRANSLATED',
  key: {
    id: 1000000901,
    name: 'dadsa dsa  dsaaa sd a asda dsasd sadas dsad',
    links: []
  },
  links: []
}

Authentication

You can connect to socket.io server with your apiKey

const client = new TranslationsClient({
  authentication: {
    apiKey: 'your_cool_api_key',
  },
});

or using jwtToken and projectId:

const client = new TranslationsClient({
  authentication: {
    projectId: 104,
    jwtToken: 'your cool jwtToken'
  },
});

Supported events

  • connect_error
  • connect
  • translation_created
  • translation_modified
  • translation_deleted
  • key_created
  • key_modified
  • key_deleted
  • reconnect_attempt

FAQs

Package last updated on 01 Aug 2022

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