Skip to content

Instantly share code, notes, and snippets.

HypeLab SDK Migration Guide - Vanilla

Installation

  • Remove the hypelab-vanilla script tag from your head tag.
  • Remove any script referencing the HypeLab client, and any call to HypeLab.setClient(client);
  • Include the HypeLab SDK script tag as shown in our docs. Example:
 <head>
-    <script src="https://cdn.jsdelivr.net/gh/gohypelab/hypelab-vanilla@vX.X.X/index.js"></script>
+    <script defer src="https://api.hypelab.com/v1/scripts/hp-sdk.js?v=0"></script>

HypeLab SDK Migration Guide - React

Installation

  • Remove the hypelab-react package from your package.json, and instead install @hypelab/sdk-react.
  • Remove any instances of the HypeLab client and HypeLabContext components from your application.
  • Include the HypeLab SDK script tag as shown in our docs for your React framework.

Formats

@wengzilla
wengzilla / README.md
Last active August 11, 2023 22:05
HypeLab Analytics

HypeLab Analytics SDK

Our Analytics SDK is designed to provide practical benefits for your HypeLab ads. By integrating this SDK into your website, you will be able to easily share deeper funnel analytics events back to HypeLab, which will help our personalization algorithms learn about what works and what doesn't. Ultimately, this should translate into better return on ad spend (ROAS) for you.

What are conversions?

When someone takes a specific action after interacting with your ad, that's a conversion. Sending a conversion tells us that a user is engaging in behavior that aligns with your goals! In web3 advertising, conversion actions can be anything from a user connecting their wallet to a player signing up for an NFT whitelist. If you celebrate it and count it as a win, you should be sending a conversion. Here are some of the most common conversions we see:

  • Connecting a wallet
  • Submitting a transaction
@wengzilla
wengzilla / machine.js
Created February 14, 2021 04:45
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
class RandomWalk
attr_accessor :outcome, :step_count
def initialize(upper_bound, lower_bound, step_size, win_probability)
@step_count = 0
@current_position = 0
@upper_bound = upper_bound
@lower_bound = lower_bound
@step_size = step_size

Keybase proof

I hereby claim:

  • I am wengzilla on github.
  • I am wengzilla (https://keybase.io/wengzilla) on keybase.
  • I have a public key whose fingerprint is B3F1 4DE7 9F5D ADC7 94DE CAF0 B707 8861 2240 530D

To claim this, I am signing this object:

@wengzilla
wengzilla / concordance.java
Created August 7, 2014 14:46
Bug-free version of concordance.java
public class Concordance {
public static void main(String[] args) {
System.out.println(args[0]);
In in = new In(args[0]);
String[] words = in.readAllStrings();
// String[] words = StdIn.readAll().split("\\s+");
// Not sure this is the intended behavior, I believe it's supposed to do the splitting on the input file.
ST<String, SET<Integer>> st = new ST<String, SET<Integer>>();
for (int i = 0; i < words.length; i++)
{
@wengzilla
wengzilla / template.html
Created March 22, 2014 15:27
Templating AngularJS App
<html ng-app="TemplateApp">
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.15/angular.min.js"></script>
</head>
<body>
<div ng-controller="TemplateController">
<h1>Input</h1>
<div id="templateInputs">
package main
import (
"crypto/sha1"
"fmt"
"io"
"bytes"
"os"
"bufio"
"os/exec"