npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

mystic-sdk-1

v1.9.7

Published

Add our swap module as a React component

Downloads

31

Readme

Mystic Frontend Swap SDK

Add our swap module as a React component

Installation

npm i mystic-sdk-1
yarn add mystic-sdk-1

Setup

To add the Mystic frontend SDK to your website or application, all you need to do is add our React component to your website and associate your Bearer token to it.

First, let's add the React component to your website's UI. Assuming it's a React app, here's what you would add to the page you want the component to be in:

import React from 'react';
import { MysticSdk } from 'mystic-sdk-1';

const SdkPage = () => {
  return (
    <div className="sdk_page">
      <MysticSdk />
    </div>
  );
};

export default SdkPage;

Great, you've added the component! Now, to authenticate your API calls, you'll need to add your Bearer token as a token prop in the component as well. To do so, retrieve your Bearer token from your Admin Dashboard and then add it to your env file / where you are storing your credentials. Once you have done so, import the Bearer token and then pass the token prop in the component, like so:

import React from 'react';
import { MysticSdk } from 'mystic-sdk-1';
import BEARER_TOKEN from '../path';

const SdkPage = () => {
  return (
    <div className="sdk_page">
      <MysticSdk token={BEARER_TOKEN} />
    </div>
  );
};

export default SdkPage;

If you have followed these steps correctly, you will see the Mystic swap module appear on your webpage. You can see it here, it will look like this: Screenshot of swap sdk

Customisation

To change the styles of the MysticSdk component to match your branding, you simply have to override the CSS classes wrapping the component and add your own style to them.

All classes are prefixed with mystic_sdk_, so they don't override your other classes.

Here is an example of how you would change the colour of your listing screen to red:

.mystic_sdk_listing_screen: {
  background-color: red;
}

Happy coding!

// "@imtbl/imx-sdk": "^3.8.0", // "@imtbl/sdk": "^1.23.3",