Skip to content

Commit

Permalink
Fix: don't load Spindl if no SDK key (#3154)
Browse files Browse the repository at this point in the history
* Fix: don't load Spindl if no SDK key

* Add Spindl key to the readme
  • Loading branch information
katspaugh authored Jan 25, 2024
1 parent 4173ffd commit 5ee1aff
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ Here's the list of all the environment variables:
| `NEXT_PUBLIC_FIREBASE_VAPID_KEY_STAGING` | FCM vapid key on staging
| `NEXT_PUBLIC_SOCIAL_WALLET_OPTIONS_PRODUCTION` | Web3Auth and Google credentials (production)
| `NEXT_PUBLIC_SOCIAL_WALLET_OPTIONS_STAGING` | Web3Auth and Google credentials (staging)
| `NEXT_PUBLIC_SPINDL_SDK_KEY` | [Spindl](http://spindl.xyz) SDK key

If you don't provide some of the variables, the corresponding features will be disabled in the UI.

Expand Down
4 changes: 2 additions & 2 deletions src/services/analytics/spindl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import spindl from '@spindl-xyz/attribution-lite'
import { IS_PRODUCTION } from '@/config/constants'

export const spindlInit = () => {
if (!IS_PRODUCTION) return

const SPINDL_SDK_KEY = process.env.NEXT_PUBLIC_SPINDL_SDK_KEY

if (!IS_PRODUCTION || !SPINDL_SDK_KEY) return

spindl.configure({
sdkKey: SPINDL_SDK_KEY || '',
debugMode: false,
Expand Down

0 comments on commit 5ee1aff

Please sign in to comment.