Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
@oxyhq/services
Advanced tools
The Oxy Services Module is a comprehensive package designed to provide reusable services and components for building front-end applications with Oxy. It includes hooks and components for session management, user handling, and more, making it easier to int
The Oxy Services Module is a comprehensive package designed to provide reusable services and components for building front-end applications with Oxy. It includes hooks and components for session management, user handling, and more, making it easier to integrate Oxy-based functionalities into your React applications.
useOxySession
.getUserById
.SignInButton
, AccountSwitcherModal
, and SessionOwnerButton
.To use the OxyServicesModule, follow these steps:
Install the package:
npm install @oxyhq/services
Import the necessary components and hooks in your project:
import { useOxySession, getUserById, SignInButton, AccountSwitcherModal, SessionOwnerButton } from '@oxyhq/services';
Use the components and hooks in your application. For example, to use the SignInButton
component:
import React from 'react';
import { SignInButton } from '@oxyhq/services';
const App = () => {
return (
<div>
<SignInButton />
</div>
);
};
export default App;
useOxySession
HookThe useOxySession
hook fetches session data and provides error handling and status management.
import React from 'react';
import { useOxySession } from '@oxyhq/services';
const SessionComponent = () => {
const { session, status, error } = useOxySession();
if (status === 'loading') {
return <div>Loading...</div>;
}
if (status === 'error') {
return <div>Error: {error}</div>;
}
return (
<div>
<h1>Welcome, {session.user.name}!</h1>
<p>Email: {session.user.email}</p>
</div>
);
};
export default SessionComponent;
getUserById
FunctionThe getUserById
function fetches user data by ID and handles possible errors.
import React, { useEffect, useState } from 'react';
import { getUserById } from '@oxyhq/services';
const UserComponent = ({ userId }) => {
const [user, setUser] = useState(null);
const [error, setError] = useState(null);
useEffect(() => {
const fetchUser = async () => {
try {
const fetchedUser = await getUserById(userId);
setUser(fetchedUser);
} catch (err) {
setError(err.message);
}
};
fetchUser();
}, [userId]);
if (error) {
return <div>Error: {error}</div>;
}
if (!user) {
return <div>Loading...</div>;
}
return (
<div>
<h1>{user.name}</h1>
<p>Email: {user.email}</p>
</div>
);
};
export default UserComponent;
FAQs
The Oxy Services Module is a comprehensive package designed to provide reusable services and components for building front-end applications with Oxy. It includes hooks and components for session management, user handling, and more, making it easier to int
The npm package @oxyhq/services receives a total of 115 weekly downloads. As such, @oxyhq/services popularity was classified as not popular.
We found that @oxyhq/services 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.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.