![require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages](https://cdn.sanity.io/images/cgdhsj6q/production/be8ab80c8efa5907bc341c6fefe9aa20d239d890-1600x1097.png?w=400&fit=max&auto=format)
Security News
require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
device-check
Advanced tools
A Promise-based Node.js client for the Apple device check API. https://developer.apple.com/documentation/devicecheck/accessing_and_modifying_per-device_data
npm install device-check
const deviceCheck = new DeviceCheck(ApiHost.DEVELOPMENT);
const key = readFileSync('key.p8').toString();
const jwt = jsonwebtoken.sign({}, key, { algorithm: 'ES256', keyid: 'AP00LNP89K', issuer: 'PJK0EZJ3I6' });
try {
const queryResult = await deviceCheck.QueryDevice(jwt, {
device_token: 'aDeviceToken',
// Optional, will be set as Date.now() if omitted
timestamp: Date.now()
// Optional, will be set as V4 UUID if omitted
transaction_id: 'aTransactionId'
});
} catch (err) {
console.log(err);
}
const key = readFileSync('key.p8').toString();
const jwt = jsonwebtoken.sign({}, key, { algorithm: 'ES256', keyid: 'AP00LNP89K', issuer: 'PJK0EZJ3I6' });
try {
await deviceCheck.UpdateDevice(jwt, {
device_token: 'aDeviceToken',
// Optional, will be default to Date.now() if omitted
timestamp: Date.now()
// Optional, will be default to V4 UUID if omitted
transaction_id: 'aTransactionId'
bit0: true,
bit1: false
});
} catch (err) {
console.log(err);
}
const key = readFileSync('key.p8').toString();
const jwt = jsonwebtoken.sign({}, key, { algorithm: 'ES256', keyid: 'AP00LNP89K', issuer: 'PJK0EZJ3I6' });
// Will throw if device token is invalid
try {
await deviceCheck.ValidateDevice(jwt, {
device_token: 'aDeviceToken',
// Optional, will be default to Date.now() if omitted
timestamp: Date.now()
// Optional, will be default to V4 UUID if omitted
transaction_id: 'aTransactionId'
});
} catch (err) {
console.log(err);
}
FAQs
A Promise-based Node.js client for the Apple device check API
The npm package device-check receives a total of 738 weekly downloads. As such, device-check popularity was classified as not popular.
We found that device-check 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
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.