
Research
Security News
Lazarus Strikes npm Again with New Wave of Malicious Packages
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
svix-react
Advanced tools
yarn add svix-react svix
# or
npm i svix-react svix
import React from "react";
import ReactDOM from "react-dom";
import { AppPortal } from "svix-react";
import "svix-react/style.css";
const SvixEmbed = () => {
const svixAppId = 'app_x'; // this might vary from customer to customer
const [appPortal, setAppPortal] = React.useState(null);
const svixAppPortal = React.useEffect(() => {
// Prerequisite: You'll need an endpoint that returns the App Portal
// magic URL (https://api.svix.com/docs#operation/get_dashboard_access_api_v1_auth_dashboard_access__app_id___post)
fetch(`/your-backend-service/svix/${svixAppId}/app-portal`, { method: "POST" })
.then(res => res.json())
.then(result => setAppPortal(result));
}, [svixAppId]);
return (
<AppPortal url={appPortal?.url} />
);
};
const App = () => (
<SvixEmbed />
);
ReactDOM.render(<App />, document.body);
If you need <AppPortal />
to adjust its height based on its content (e.g. to remove scrollbars), you can pass the fullSize
prop like this:
<AppPortal fullSize />
This library also provides some custom hooks that can be helpful when implementing a custom App Portal.
To use the hooks, you must wrap your app inside the SvixProvider component:
<SvixProvider
token={token}
appId={appId}
>
{/* Your app's components */}
</SvixProvider>
Svix hooks must be called from within the provider's hierarchy. You can also optionally pass a SvixOptions
object via the options
property.
You'll see most of the hooks accept and return these standardized types.
An object for controlling iteration over large sets of data
export interface SvixPaginatedOptions {
limit?: number;
iterator?: Iterator;
}
An object that allows for easy iteration over large sets of data
export interface SvixPaginatedData<T> {
data: T[] | undefined;
reload: () => void;
hasPrevPage: boolean;
hasNextPage: boolean;
prevPage: () => void;
nextPage: () => void;
loading: boolean;
error: Error | undefined;
iterator: Iterator;
}
An object for interacting with a Svix entity
interface SvixEntity<T> {
data: T | undefined;
reload: () => void;
loading: boolean;
error: Error | undefined;
}
Note: these hooks must be used within the SvixProvider
context.
function useSvix(): {
svix: Svix,
appId: string
}
function useEndpoints(options?: SvixPaginatedOptions): SvixPaginatedData<EndpointOut>
function useEndpoint(endpointId: string): SvixEntity<EndpointOut>
function useEndpointMessageAttempts(endpointId: string, options?: SvixPaginatedOptionsAttempts): SvixPaginatedData<MessageAttemptOut>
function useEndpointSecret(endpointId: string): {
rotateSecret: (newSecret: EndpointSecretRotateIn) => Promise<void>
} extends SvixEntity<EndpointSecretOut>
function useEndpointHeaders(endpointId: string): {
updateEndpointHeaders: (headers: EndpointHeadersIn) => Promise<void>,
patchHeaders: (headers: EndpointHeadersPatchIn) => Promise<void>
} extends SvixEntity<EndpointHeadersOut>
function useEndpointFunctions(endpointId: string): {
recoverEndpointMessages: (options: RecoverIn) => Promise<void>,
updateEndpoint: (options: EndpointUpdate) => Promise<EndpointOut>,
deleteEndpoint: () => Promise<void>
}
function useEndpointStats(endpointId: string): SvixEntity<EndpointStats>
function useNewEndpoint(): {
url: SvixField,
description: SvixField,
eventTypes: SvixField,
rateLimitPerSecond: SvixField,
createEndpoint: () => Promise<{ endpoint: EndpointOut, error: Error }>
}
function useEventTypes(options?: SvixPaginatedOptions): SvixPaginatedData<EventTypeOut>
function useMessages(options?: SvixPaginatedOptionsMessages): SvixPaginatedData<MessageOut>
function useMessage(messageId: string): SvixEntity<MessageOut>
function (messageId: string, options?: SvixPaginatedOptions): SvixPaginatedData<MessageEndpointOut>
function useMessageAttempts(messageId: string, options?: SvixPaginatedOptionsAttempts): SvixPaginatedData<MessageAttemptOut>
function useMessageAttemptFunctions(attempt: MessageAttemptOut): {
resendAttempt: () => Promise<void>
}
FAQs
React components for using Svix in your dashboard.
The npm package svix-react receives a total of 11,164 weekly downloads. As such, svix-react popularity was classified as popular.
We found that svix-react demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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.
Research
Security News
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.
Security News
Opengrep continues building momentum with the alpha release of its Playground tool, demonstrating the project's rapid evolution just two months after its initial launch.