Logo

dev-resources.site

for different kinds of informations.

TypeScript library for Localazy API

Published at
3/25/2022
Categories
howto
api
devtips
Author
localazyteam
Categories
3 categories in total
howto
open
api
open
devtips
open
Author
12 person written this
localazyteam
open
TypeScript library for Localazy API

▶️ Production-ready today

As an example, our Figma plugin for Localazy revolves around API and shows that you can use it to build powerful plugins and tools. However, it may be daunting to start as REST-based API generally provides only basic functionality and complex logic needs to be built on top of it. Therefore, starting from scratch will generally include studying the documentation, trying out various endpoints, inspecting responses, and then creating some kind of personal library to abstract some of the complexity.

📚 TypeScript library to get you started

Well, if you're going to use either JavaScript or TypeScript, you're in luck! We've built a zero-dependency library that takes care of the basic concepts such as authentication or type definition. The library provides several methods that should cover most of your needs.

You just need to install it as a dependency in your project to get started.

npm install @localazy/ts-api
Enter fullscreen mode Exit fullscreen mode

Afterward, import the library and initialize it.

import LocalazyApi from '@localazy/ts-api';

const api = LocalazyApi({
    projectToken: "your-project-token"
    // ...additional options
})
Enter fullscreen mode Exit fullscreen mode

That's it. You can immediately begin to fetch data from Localazy, such as a list of projects with listProjects the method, all the keys for a given project, file, and language with listKeysInFileForLanguage and then upload modified content with import.

See the project's GitHub page for an overview of all the supported methods. Or head over to this article about the dynamic localization of ad banners to see this library in action.

Project token

To access anything from Localazy, you need to sign up and create a project. Then, you'll be able to generate a project token here. See documentation for more information.

✔️ Closing words

We hope this small library will help you get the best of Localazy API.

To see the complete list of supported methods or to report a bug/feature request, please head to GitHub. Don't hesitate to contact us via [email protected] or join our Discord channel if you have any questions. Happy coding!

devtips Article's
30 articles in total
Favicon
𝐓𝐡𝐞 𝐌𝐢𝐬𝐭𝐚𝐤𝐞𝐬 𝐈 𝐌𝐚𝐝𝐞 𝐀𝐬 𝐚 𝐁𝐞𝐠𝐢𝐧𝐧𝐞𝐫 𝐏𝐫𝐨𝐠𝐫𝐚𝐦𝐦𝐞𝐫
Favicon
Debugging Techniques Every Developer Should Know
Favicon
13 Hidden Windows Productivity Tricks You Should Know
Favicon
Tkinter: Python's Secret Weapon for Stunning GUIs
Favicon
Tips and Tricks for Docker Compose: Leveraging the override Feature
Favicon
Essential Security Practices for Web Developers: Keep Your Code Safe and Sound
Favicon
13 Hidden Windows Productivity Tricks You Should Know
Favicon
Automating Laravel Tasks with JSON-Based Task Runner
Favicon
8 Plugins You Should Add To Your IDE And Why
Favicon
How to Safely Edit a Git Commit Message After Pushing *Demystifying one of the tricky aspects of Git*
Favicon
A Guide to Efficient Problem Solving: Techniques for Tackling Coding Challenges
Favicon
How to improve the PageSpeed score of your Nuxt.js website in 6 steps
Favicon
Top 10 Vue.js Resources For Your Project 🚀
Favicon
How is testing different in monolith and microservices architectures?
Favicon
Top 15 Flutter Tools that you should know
Favicon
Top 10 tools for (not only) multilingual Android development
Favicon
Why allow users to switch languages
Favicon
Top 10 Android Libraries to boost your development in 2022
Favicon
Seven reasons why you should use Microservices architecture
Favicon
TypeScript library for Localazy API
Favicon
Cheatsheet: Getting started with Software Localization
Favicon
My paper to-do strategy
Favicon
Measuring productivity with GitHub issues
Favicon
How to set up `git bro` command with git alias
Favicon
Digital resilience: redundancy for websites and communications
Favicon
CodeSandbox init shortcuts
Favicon
How to become a software developer
Favicon
How to write good documentation
Favicon
So you're the family tech support
Favicon
Transforming an object to array in JavaScript

Featured ones: