
Product
Unify Your Security Stack with Socket Basics
A single platform for static analysis, secrets detection, container scanning, and CVE checks—built on trusted open source tools, ready to run out of the box.
@cognite/dune-fe-auth
Advanced tools
Authentication utilities for Cognite Data Fusion React applications
Authentication utilities for Cognite Data Fusion React applications.
npm install @cognite/dune-fe-auth
Wrap your application with the CDFAuthenticationProvider
to provide CDF SDK context:
import { CDFAuthenticationProvider } from '@cognite/dune-fe-auth';
function App() {
return (
<CDFAuthenticationProvider>
<YourAppComponents />
</CDFAuthenticationProvider>
);
}
Use the useCDF
hook to access the Cognite SDK in your components:
import { useCDF } from '@cognite/dune-fe-auth';
function MyComponent() {
const { sdk } = useCDF();
// Use the SDK to interact with CDF
const assets = await sdk.assets.list();
return <div>...</div>;
}
The package also exports utility functions for authentication:
import { getToken, getLocalHostSDK, EMPTY_SDK } from '@cognite/dune-fe-auth';
// Get an access token
const token = await getToken(clientId, clientSecret);
// Get a configured SDK for localhost development
const sdk = await getLocalHostSDK();
For localhost development, ensure these environment variables are set:
PROJECT
- Your CDF project nameBASE_URL
- CDF base URLCLIENT_ID
- OAuth client IDCLIENT_SECRET
- OAuth client secretCopy the provided template file:
cp .env.template .env
Fill in your actual values in the .env
file
This package requires:
@cognite/sdk
^8.0.0react
^18.0.0# Install dependencies
npm install
# Build the package
npm run build
# Watch for changes during development
npm run dev
# Preview the built package
npm run preview
# Type check
npm run type-check
npm publish
MIT
FAQs
Authentication utilities for Cognite Data Fusion React applications
The npm package @cognite/dune-fe-auth receives a total of 5 weekly downloads. As such, @cognite/dune-fe-auth popularity was classified as not popular.
We found that @cognite/dune-fe-auth demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 261 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.
Product
A single platform for static analysis, secrets detection, container scanning, and CVE checks—built on trusted open source tools, ready to run out of the box.
Product
Socket is launching experimental protection for the Hugging Face ecosystem, scanning for malware and malicious payload injections inside model files to prevent silent AI supply chain attacks.
Research
/Security News
The Socket Threat Research Team uncovered a coordinated campaign that floods the Chrome Web Store with 131 rebranded clones of a WhatsApp Web automation extension to spam Brazilian users.