Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
@ably/asset-tracking
Advanced tools
JavaScript client SDKs for the Ably Asset Tracking service.
Readme
Ably Asset Tracking SDKs provide an easy way to track multiple assets with realtime location updates powered by Ably realtime network and Mapbox Navigation SDK with location enhancement.
Status: this is a preview version of the SDK. That means that it contains a subset of the final SDK functionality, and the APIs are subject to change. The latest release of this SDK is available in the Released section of this repository.
Ably Asset Tracking is:
This repository contains the Asset Subscribing SDK for Web.
Visit the Ably Asset Tracking documentation for a complete API reference and code examples.
To use Ably Asset Tracking in your app, install it as a dependency:
# If you are using NPM:
npm install @ably/asset-tracking
# If you are using Yarn:
yarn add @ably/asset-tracking
import { Subscriber } from '@ably/asset-tracking';
// Client options passed to the underling ably-js instance.
// You must provide some way for the client to authenticate with Ably.
// In this example we're using basic authentication which means we must also provide a clientId.
// See: https://ably.com/docs/core-features/authentication
const ablyOptions = {
key: ABLY_API_KEY,
clientId: CLIENT_ID,
};
// Create a Subscriber instance.
const subscriber = new Subscriber({
ablyOptions,
});
// Get an asset.
const asset = subscriber.get('my_tracking_id');
// Define a callback to be notified when a location update is recieved.
asset.addLocationListener((locationUpdate) => {
console.log(`Location update recieved. Coordinates: ${locationUpdate.location.geometry.coordinates}`);
});
// Start tracking the asset. This will attach to the Ably realtime channel and enter presence.
await asset.start(trackingId);
// Stop tracking the asset, at some point later on when you no longer need to receive location updates.
await asset.stop();
// Register a callback to be notified when the asset online status is updated.
asset.addStatusListener((isOnline) => {
console.log(`Status update: Publisher is now ${isOnline ? 'online' : 'offline'}`);
});
import { Accuracy } from '@ably/asset-tracking';
// You can request a specific resolution to be considered by the publisher when you create an asset instance...
const resolution = {
accuracy: Accuracy.High,
desiredInterval: 1000,
minimumDisplacement: 1,
};
const asset = subscriber.get('my_tracking_id', resolution);
// ...And you can send a request to change the resolution when the asset is already started
await asset.sendChangeRequest({
accuracy: Accuracy.Low,
desiredInterval: 3000,
minimumDisplacement: 5,
});
This repository also contains an example app that showcases how the Ably Asset Tracking SDK can be used:
see Contributing.
FAQs
JavaScript client SDKs for the Ably Asset Tracking service.
The npm package @ably/asset-tracking receives a total of 5 weekly downloads. As such, @ably/asset-tracking popularity was classified as not popular.
We found that @ably/asset-tracking demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 6 open source maintainers 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
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.