Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
@psychic-api/link
Advanced tools
`@psychic-api/link` is a React library that provides a hook for easy authentication with popular SaaS applications such as Notion, Google Drive, and more. Find us at https://psychic.dev
Readme
@psychic-api/link
is a React library that provides a hook for easy authentication with popular SaaS applications such as Notion, Google Drive, and more. Find us at https://psychic.dev
Install the library using npm:
npm install @psychic-api/link
Here's an example of how to use the library:
import React, { useEffect, useState } from 'react';
import { usePsychicLink } from '@psychic-api/link';
const App = () => {
const [newConnection, setNewConnection] = useState(null);
// Your Psychic.dev public API key
const publicKey = '5c362fda-bb72-4a6c-b930-71f33ad45f79';
// Unique ID for the account that is requesting this connection
const accountId = '2cbaa840-0b21-4d8e-924c-e418a08ce53f';
// usePsychicLink accepts a callback that handles your application logic once a new connection is established
const { open, isReady, isLoading, error } = usePsychicLink(publicKey, (newConnection: {accountId: string, connectorId: string}) => setNewConnection(newConnection));
useEffect(() => {
// Shows the Psychic Link modal to the user
open(accountId);
}, []);
return (
<div className="App">
{newConnection && <div>{newConnection}</div>}
</div>
);
};
export default App;
By default, the Psychic modal displays a list of connectors for the user to pick. If you want the modal to open to a specific connector, such as Notion, use the optional connectorId
parameter in the open
function:
// Import the ConnectorId enum
import { usePsychicLink, ConnectorId } from '@psychic-api/link';
// Pass in the connector that you want to display to the user
open(accountId, ConnectorId.Notion);
For assistance, join the Psychic community Slack here
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
`@psychic-api/link` is a React library that provides a hook for easy authentication with popular SaaS applications such as Notion, Google Drive, and more. Find us at https://psychic.dev
The npm package @psychic-api/link receives a total of 303 weekly downloads. As such, @psychic-api/link popularity was classified as not popular.
We found that @psychic-api/link demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
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.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.