This is the client side boilerplate of remote platform integration for Texts.
It is made in a way that you only need to update frontend file auth.tsx
to add whatever is necessary for backend server to handle the requests.
Server side boilerplate at https://github.com/batuhan/texts-platform-remote-server-boilerplate
Before you begin. ensure you have the following installed.
- Clone this repository and navigate into the project directory:
git clone https://github.com/batuhan/texts-platform-remote-client.git && cd texts-platform-remote-client
- Install dependencies and build the project:
yarn install
yarn build
- Open Texts and access the command bar (
CMD+J
on macOS) to select Install platform integrations - Choose Load platform from directory, navigate inside of the
dist
directory generated byyarn build
- Restart Texts to apply changes.
- Make sure you have platform remote server running.
- Log in to this remote integration by entering the Base URL for your remote server and any other necessary information.
For integrations requiring additional user credentials, such as an API key, or username-password pairs, the auth.tsx
file facilitates easy customization for this data.
Let's assume you need to add an API Key field.
- Add a new state variable for the new input
const [apiKey, setApiKey] = useState("");
- Add a new input for the API Key
<input
id="api-key"
type="text"
value={apiKey}
onChange={(event: React.ChangeEvent<HTMLInputElement>) =>
setApiKey(event.target.value)
}
style={{ width: "100%" }}
placeholder="Enter API Key"
/>
- Pass the new input to login function. Which will be passed to server.
login({ custom: { label, baseURL, apiKey } });
This integration was built at Pickled Works by @alperdegre and it isn't an official integration by Texts.