⚡
claimr
  • Getting started
    • Create an account
    • Sign in to your account
    • Reset password
    • Edit profile
  • ⚡️claimr core components
  • Team roles and management
  • Campaigns
    • Create new campaign
    • Campaign settings
  • Groups
    • Create new group
    • Group settings
  • Quests
    • Create new quest
    • Quest settings
  • Tasks
    • Create new task
    • Task settings
    • Telegram tasks
    • X (Twitter) tasks
    • TikTok tasks
    • Discord tasks
    • YouTube tasks
    • Web3 tasks
      • Connect a wallet
      • Transactions count
      • Wallet balance
      • Token balance
      • NFT balance
      • Link3 balance
      • Mint an NFT (721)
      • Mint an NFT (1155)
      • Verify transactions
    • PoW tasks
    • HTTP request tasks
    • Referral tasks
    • Form tasks
    • Poll tasks
    • Events tasks
    • API tasks
  • Widget
    • Publish campaign
    • Widget configurations
    • Widget attributes
    • Integrate claimr widget into your website
    • claimr widget integrations
      • Google Analytics integration
      • Google Analytics Client ID
      • Google Tag Manager integration
      • HotJar integration
  • Rewards
    • Reward settings
    • Custom rewards
  • Events
    • Daily check-ins
    • Challenges
    • Ranks
    • KOLs
  • Codes
    • Secret codes
    • Invite codes
      • Enter invite code task
      • Claim invite code task
    • Gift codes
  • Test users
  • Pop-ups
    • Into pop-up
    • Completion pop-up
  • API
    • API token
    • API methods
    • User token
  • Webhooks
    • Set up webhooks
    • Assign webhooks
    • Webhook scopes
  • SDK
  • Forms
    • Create forms
    • Form settings
    • Pages
    • Blocks
    • Quizzes
  • Data analytics
    • Activity
    • PoW analytics
    • User information
    • Failed actions
    • Issues analytics
  • How to
    • Create X campaign
    • Create Discord campaign
    • Integrate claimr widget into dApp
    • Integrating claimr widget into Telegram mini app
    • Customize user experience with tags and attributes
    • Add custom points to users
  • UX requirements
    • Campaign UX requirements
    • Group UX requirements
    • Quest card UX requirements
    • Quest UX requirements
    • Task UX requirements
    • User progress UX requirements
    • Pop-ups UX requirements
    • Interactive components UX requirements
Powered by GitBook
On this page
  • Methods
  • complete_task(task_id)
  • connect_wallet(address, signature, message)
  • destroy()
  • get_user_info(campaign_id, public_key, account, platform)
  • login()
  • logout()
  • open_quest(quest_id)
  • set_theme(theme)
  • set_user_token(token)
  • Events
  • on_contest_open
  • on_custom_login
  • on_logout
  • Parameters
  • user

Was this helpful?

SDK

Use SDK to integrate ⚡️claimr into your web application, customize its behavior, and create a more engaging and rewarding user experience.

SDK (Software Development Kit) is a powerful tool that integrates claimr's functionalities into your web application. It provides a set of methods and events that enable you to interact with the claimr widget, customize its behavior, and enhance the user experience.

Methods

complete_task(task_id)

This method allows you to mark a task as complete directly from your web application's front-end. This is useful for tasks that are completed outside of the claimr widget, such as watching a video or visiting a specific page on your website.

  • The task_id parameter should be the unique identifier of the task you want to complete, which can be found in your claimr admin panel.

This method should only be used for tasks that are configured as "Front End" type in your claimr campaign settings.

connect_wallet(address, signature, message)

This method enables users to sign in to your claimr campaign using their web3 wallet credentials.

  • The address parameter should be the user's wallet address.

  • The signature parameter should be the cryptographic signature generated by the user's wallet.

  • The message parameter should be the message that was signed by the user's wallet.

destroy()

This method removes the claimr widget instance from your web page.

get_user_info(campaign_id, public_key, account, platform)

This method retrieves information about a specific user from your claimr campaign using the public API.

  • The campaign_id parameter should be the unique identifier of your campaign.

  • The public_key parameter should be the public key generated in your campaign's general settings.

  • The account parameter should be the user's account identifier. For web3 wallet addresses, use the address in lowercase.

  • The platform parameter should be the platform identifier. For web3 wallets, use "web3".

login()

This method triggers the login dialog within the claimr widget, allowing users to sign in to their claimr account.

logout()

This method logs the user out of their claimr account within the widget.

open_quest(quest_id)

This method opens a specific quest within the claimr widget.

  • The quest_id parameter should be the unique identifier of the quest you want to open, which can be found in your claimr admin panel.

set_theme(theme)

This method allows you to set the theme of the claimr widget if supported by your CSS.

  • The theme parameter should be a string representing the desired theme ("light" or "dark").

set_user_token(token)

This method sets the user token generated by the claimr API. This token is used to associate a user's actions within the claimr widget with their account on your platform.

  • The token parameter should be the user token generated by the API. Refer to the claimr API documentation for details on generating user tokens.

Events

on_contest_open

This event is fired when a user opens any quest within the claimr widget.

on_custom_login

This event is fired when a user logs in using the "custom" sign-in option.

on_logout

This event is fired when a user logs out of their claimr account within the widget.

Parameters

user

This parameter contains information about the currently logged-in user, such as their user ID, name, and email address.

PreviousWebhook scopesNextForms

Last updated 5 months ago

Was this helpful?

Page cover image