New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@senantix/atomic-js

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@senantix/atomic-js

## User allocation and deallocation algorithm 1. User receives `atomic_visitor_id` (100 year cookie) and an `atomic_session_id` (session cookie) in cookies when they visit the site. This `atomic_visitor_id` serves as the consistent identifier for the user

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4
Maintainers
1
Weekly downloads
 
Created
Source

Core docs

User allocation and deallocation algorithm

  1. User receives atomic_visitor_id (100 year cookie) and an atomic_session_id (session cookie) in cookies when they visit the site. This atomic_visitor_id serves as the consistent identifier for the user across sessions.

  2. Visit to the experimentation page triggers the bucketing function, which hashes the atomic_visitor_id || feature_flag combination, and creates a bucket value between 0 and 1000.

  3. Fetch the allocation weights for the current feature_flag, epoch and round from the server. For example, the server indicates that for a bucket value of 33, the user is assigned to variant A.

  4. Display variant A on the checkout page based on the assignment.

  5. Store the variant assignment in the cookies, such as "checkout_page": "variant A", for faster lookups on future visits.

{
  "experiment_id": {
    "variant": "variant_id",
    "epoch": "epoch_id",
  }
}
  1. When the user visits the checkout page again, the stored variant assignment is used to display the same variant as before. If the variant with variant_id is not present => display the default variant. If the epoch_id is different from the current running epoch_id, the user is re-allocated to a new variant.

Keywords

FAQs

Package last updated on 26 Sep 2024

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc