Vanilla JS quickstart
If you do not want the React or Next integration layers, use the core engine directly.
Install
npm install @18ways/coreBasic translation
import { create18waysEngine } from '@18ways/core/engine';
const ways = create18waysEngine({
apiKey: 'YOUR_18WAYS_PUBLIC_API_KEY',
locale: 'fr-FR',
baseLocale: 'en-GB',
context: 'app',
});
const hello = await ways.t('Hello world');
ways.setLocale('de-DE');
const cta = await ways.t('Pay now', {
context: 'checkout.button',
});From there, add vars, caching, and your own rendering flow in the Usage page.
Next: Vanilla JS usage