Setup JavaScript SDK
In this article, you will find all the information regarding setting up your Transifex project to leverage the Transifex Native SDK.
To get started with a Transifex Native setup you will need to have:
- A Transifex account, either create a new account or sign in if you are an existing user.
- Create a new Transifex Native project from within the Transifex application.
Installation
Transifex Native supports node.js 12.x.x versions and above.
To install the SDK to your project use this command:
$ npm install @transifex/native @transifex/cli --save
Authentication
To be able to authenticate you will need a set of credentials for the specific Transifex project you want to set up Transifex Native on.
Transifex Native SDK communicates with Transifex through the Transifex Content Delivery Service and requires the following credentials:
project_secret
, related to your Transifex project and used for pushing source content to Transifexproject_token
, again related to your Transifex project and used for pulling translations from Transifex
Once you have those two credentials you can proceed to configuring your project.
Before using Transifex Native you need to initialize it using the following snippet:
import { tx } from '@transifex/native';
tx.init({
// Public project token, defaults to empty string
token: 'project_token',
});
Updated over 2 years ago