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
package main
import (
"crypto/sha1"
"fmt"
"io"
"bytes"
"os"
"bufio"
"os/exec"
@wengzilla
wengzilla / wheel_of_fortune.rb
Created January 6, 2014 05:23
Wheel of Fortune analysis of Bonus Round answers.
require 'nokogiri'
require 'open-uri'
class Analyzer
attr_accessor :frequency_table
def initialize
@frequency_table = Hash.new(0)
end
@wengzilla
wengzilla / gist:7000289
Created October 15, 2013 23:33
Ruby script to download SSL certificates for Windows machines.
# Script written by Fletcher Nichol (fnichol)
require 'net/http'
# create a path to the file "C:\RailsInstaller\cacert.pem"
cacert_file = File.join(%w{c: RailsInstaller cacert.pem})
Net::HTTP.start("curl.haxx.se") do |http|
resp = http.get("/ca/cacert.pem")
if resp.code == "200"
@wengzilla
wengzilla / du.ino
Created September 15, 2013 13:36
Arduino file for dino 0.10.0 gem.
#include <Servo.h>
bool debug = false;
int index = 0;
char messageBuffer[12];
char cmd[3];
char pin[3];
char val[4];
require 'yaml'
file_data = YAML.load_file('shipping.yaml')
class ShippingData
def initialize(attr={})
@sd_data = attr
end