What it does
The official JavaScript SDK connects JavaScript and TypeScript applications to TypeSafe’s API. Its typed question helpers allow the answer types to follow the questions you define, so a selected category can be used in the rest of your program without treating the response as a paragraph to parse.
For a web product, this call normally belongs on the server. The browser submits the user’s request to your application, your server calls Jev, and the interface displays the resulting suggestion. Keeping that boundary clear also keeps the API key out of the browser bundle.
Who it suits
This is a straightforward option for teams already maintaining a JavaScript backend. It works well when the product needs one focused decision alongside existing code, such as a suggested lead category or support queue. If your team already uses AI SDK for many providers, compare that integration too; shared conventions may matter more than having the most direct client.
A situation you might recognize
A website enquiry form receives both partnership proposals and customer questions. Your server could ask Jev for the likely purpose and show a suggested destination to the person handling the inbox. The reviewer should still see the original enquiry and be able to change the category.
If the visitor submits the same form twice, use your own request identifier to prevent duplicate records. A model response does not replace that control. Similarly, deciding that a request is urgent should not by itself grant permission to send a message or change an account.
A sensible first setup
- Check the current runtime requirements and install @typesafe-ai/sdk in the server project.
- Load the API key from your deployment environment and keep it out of client-side code.
- Define a short list of meaningful categories, then send a sample using the official client.
- Add a visible fallback for an unavailable service or an uncertain classification.
- Test the complete form-to-review flow before letting the result trigger further actions.
What to weigh before choosing
Type inference helps catch mismatched fields during development, but it cannot catch a poorly defined business category. A result can be structurally valid while sending the enquiry to the wrong team. Keep a review sample and test messages with mixed intent, spelling mistakes and the languages your customers use.
Avoid holding an interactive page open indefinitely while waiting for a decision. If classification takes too long, save the enquiry and let the user continue; your application can finish the classification later.
Accounts and running costs
The SDK is a way to access the service, not an included balance of model calls. You need suitable API access, and your hosting costs are separate from inference charges. Compare costs using the amount of text sent per request and the number of actual calls. A refresh or a repeated form submission should not needlessly classify unchanged content again.