Security News
cURL Project and Go Security Teams Reject CVSS as Broken
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
@netlify/activity-hub
Advanced tools
To keep track of activity across multiple Netlify properties, we need a centralized place where we can store activity.
To keep track of activity across multiple Netlify properties, we need a centralized place where we can store activity.
This activity is used to track progress (e.g. how much of an educational resource has been completed), determine whether someone has completed the steps to earn a community badge or other bonuses, benefits, or bragging rights.
This module is a write-only helper that makes sending activity data to the central service as painless as possible.
npm i @netlify/activity-hub
This app assumes you’ve already authenticated the user and that you have their Netlify user ID. If you need to get this, you can use Netlify OAuth and the Netlify API to retrieve it.
import netlifyActivityHub from '@netlify/activity-hub';
// this is pseudo-code; your app needs to provide the user object
const user = getNetlifyUser()
const sendActivity = netlifyActivityHub({
userId: user.id,
app: "your-app-name", // use the same app name everywhere in your app
});
// whenever you want to send activity, call `sendActivity`
document.querySelector('button').addEventListener('click', () => {
sendActivity('button-click', {
page: window.location.pathname,
})
});
netlifyActivityHub
The main function exported by @netlify/activity-hub
accepts global config and returns a function that will send activity to the Activity Hub.
import netlifyActivityHub from '@netlify/activity-hub';
// see the next section for the config object’s shape
const sendActivity = netlifyActivityHub(config);
property | type | description |
---|---|---|
userId | string | a Netlify user ID, as returned from the Netlify API |
app | string | a unique identifier for your app. this can be used to group activity later |
sendActivity
The function returned from netlifyActivityHub
accepts an event type as a string, and an object full of arbitrary data to track whatever details you want about the activity.
sendActivity(type, data);
property | type | description |
---|---|---|
type | string | any string to identify the activity type (e.g. start-playback ) |
data | object | any JSON.stringify -able data in an object that can be attached to the activity |
NOTE: don’t store any personally identifying data in the data
object
FAQs
To keep track of activity across multiple Netlify properties, we need a centralized place where we can store activity.
We found that @netlify/activity-hub demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 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
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.