
Security News
Another Round of TEA Protocol Spam Floods npm, But It’s Not a Worm
Recent coverage mislabels the latest TEA protocol spam as a worm. Here’s what’s actually happening.
@omaha/client
Advanced tools
github / npm / documentation
This is the official JavaScript client library for Omaha. It's fully typed, supports all standard endpoints and comes with a websocket client for optional event listening. Works in both browsers and server side applications. ✨
Provide an access token to start using the client immediately.
import { Omaha } from '@omaha/client';
const client = new Omaha('https://omaha.example.com', {
token: 'dG9rZW4.CilV4Ntq5GsATtmtO4ZQM6HZIzN/1i+ffuZ12CoK0Bs'
});
Use the auth.login() function to log into the desired account. The client's token will automatically be updated so
you can begin calling other endpoints immediately.
import { Omaha } from '@omaha/client';
const client = new Omaha('https://omaha.example.com');
await client.auth.login({
email: 'hello@example.com',
password: '12345678'
});
Easily get an array of releases that match your parameters.
await client.releases.search('repo_id', {
constraint: '^2.0.0'
});
First, create a new draft release with the target version. If there's another draft with the same version, it's treated as an update, so retrying any failed scripts will work.
await client.releases.create('repo_id', {
version: '2.0.1',
description: 'Optional changelog goes here.',
tags: ['latest']
});
Then upload attachments to the new release. The following example uploads an attachment for the main asset which is
the default asset for new repositories.
await client.attachments.upload('repo_id', '2.0.1', 'main', {
content: '/path/to/file.zip'
});
Once all attachments have been uploaded, you can publish the release.
await client.releases.publish('repo_id', '2.0.1');
Invoke the ws.start() function to begin listening to realtime events. Once started, the client will maintain a
constant connection to the websocket server so long as the client has an active token.
client.ws.start();
Each time a realtime connection is established, a repositories event will be transmitted with an array of all
repositories (and their corresponding collaborations) that the current token has access to.
client.ws.on('repositories', repositories => { ... });
There are also standard events for connect, connect_error, and disconnect consistent with the underlying
socket.io client. For a list of all available events, check the
types within the server code.
You can stop the realtime client at any time with client.ws.stop().
Endpoints will throw instances of HttpError from this package whenever a server-side error occurs. You can catch
specific types of errors using their class names.
These errors will always contain helpful messages that should be passed directly to the end user.
By default, the client will reattempt requests that fail due to a client-side error. This can be configured from the constructor options. You can also listen to events on the client to see when such errors occur and are recovered from.
After the error exceeds the reattempt limit, it is thrown back up to the caller. These will be plain error or
DOMException objects from the native fetch() API.
You can abort all active requests on a client at any time using the abort() method. This will cause all requests to
immediately throw an AbortError back up to their callers. You can do this multiple times on the same client over its
lifetime.
client.abort();
When working with front-end components, you may wish to create a clone of the client so as to split up any events and
aborts. To do this, use the derive() method.
const clone = client.derive();
The newly returned instance will have the same token and options as the parent client. If the token changes in the parent client, it will also change in the derived instance. However, all events and aborts are mutually exclusive.
When you're done using the instance (such as when the front-end component is detached) simply invoke the dispose()
method to abort all active requests and detach it from the parent instance for garbage collection.
Here's an example from within a svelte component:
const clone = client.derive();
const promise = clone.do.something();
onDestroy(() => clone.dispose());
Remember that aborted requests will throw an AbortError so make sure this won't cause any problems.
The client offers the following events that can be useful in some situations. Note that all events, except token,
are local to the individual client (and do not propagate back to parent nor down to derived instances).
interface OmahaEvents {
error: [error: Error];
server_error: [error: HttpError];
client_error: [error: Error, attempt: number, maxAttempts?: number];
client_recovered: [attempts: number];
token: [token?: string];
loading_start: [];
loading_stop: [];
}
MIT
FAQs
The official client library for the Omaha API.
We found that @omaha/client demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Recent coverage mislabels the latest TEA protocol spam as a worm. Here’s what’s actually happening.

Security News
PyPI adds Trusted Publishing support for GitLab Self-Managed as adoption reaches 25% of uploads

Research
/Security News
A malicious Chrome extension posing as an Ethereum wallet steals seed phrases by encoding them into Sui transactions, enabling full wallet takeover.