Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@psychic-dev/psychic-link

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@psychic-dev/psychic-link

`getsidekick` is a React library that provides a hook for easy authentication with popular SaaS applications such as Notion, Google Drive, and more.

  • 1.0.1
  • unpublished
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

getsidekick

getsidekick is a React library that provides a hook for easy authentication with popular SaaS applications such as Notion, Google Drive, and more.

Table of Contents

  • Installation
  • Usage
  • Running Locally
  • Publishing
  • Troubleshooting

Installation

Install the library using npm:

npm install getsidekick

Usage

Here's an example of how to use the getsidekick library:

import React, { useEffect } from 'react';
import { useSidekickAuth } from 'getsidekick';

const App = () => {
  const publicKey = '5c362fda-bb72-4a6c-b930-71f33ad45f79';
  const connectionId = '2cbaa840-0b21-4d8e-924c-e418a08ce53f';
  const sidekickBaseUrl = 'http://localhost:8080';

  const { authorize, loading, newConnection, error } = useSidekickAuth(publicKey, sidekickBaseUrl);

  useEffect(() => {
    authorize('notion', connectionId);
  }, []);

  return (
    <div className="App">
      {newConnection && <div>{newConnection}</div>}
    </div>
  );
};

export default App;

Running Locally

To run the getsidekick library locally, follow these steps:

  1. Build the library:

    npm run build
    
  2. Link the library to your local npm:

    npm link
    
  3. Link the library to the target project (e.g. sidekick-demo):

    cd path/to/sidekick-demo
    npm link getsidekick
    
  4. Import and use the library in the target project:

    import { useSidekickAuth } from 'getsidekick';
    

Publishing

To publish the getsidekick library, use the following command:

npm publish

Troubleshooting

Invalid Hook Call Warning

If you encounter an "Invalid hook call" warning when importing the library into another project, it might be caused by the library using a different version of React than the project. To resolve this issue, follow the instructions provided in this StackOverflow post: Invalid hook call warning - linking a React app and a local npm package

FAQs

Package last updated on 08 May 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc