Security News
Opengrep Emerges as Open Source Alternative Amid Semgrep Licensing Controversy
Opengrep forks Semgrep to preserve open source SAST in response to controversial licensing changes.
@frontegg/client
Advanced tools
Frontegg is a web platform where SaaS companies can set up their fully managed, scalable and brand aware - SaaS features and integrate them into their SaaS portals in up to 5 lines of code.
To see an example implementation, head over to our sample proxy project
Install the package using npm
npm install @frontegg/client
Frontegg offers multiple components for integration with the Frontegg's scaleable back end and front end libraries
Initialize the frontegg context when initializing your app
const { FronteggContext } = require('@frontegg/client');
FronteggContext.init({
FRONTEGG_CLIENT_ID: '<YOUR_CLIENT_ID>',
FRONTEGG_API_KEY: '<YOUR_API_KEY>',
});
Use Frontegg's "withAuthentication" auth guard to protect your routes.
A simple usage example:
const { withAuthentication } = require('@frontegg/client');
// This route can now only be accessed by authenticated users
app.use('/protected', withAuthentication(), (req, res) => {
res.status(200);
});
Head over to the Docs to find more usage examples of the guard.
Frontegg provides various clients for seamless integration with the Frontegg API.
For example, Frontegg’s Managed Audit Logs feature allows a SaaS company to embed an end-to-end working feature in just 5 lines of code
const { AuditsClient } = require('@frontegg/client');
const audits = new AuditsClient()
// initialize the module
await audits.init('MY-CLIENT-ID', 'MY-AUDITS-KEY');
await audits.sendAudit({
tenantId: 'my-tenant-id',
time: Date(),
user: 'info@frontegg.com',
resource: 'Portal',
action: 'Login',
severity: 'Medium',
ip: '1.2.3.4'
});
const { data, total } = await audits.getAudits({
tenantId: 'my-tenant-id',
filter: 'any-text-filter',
sortBy: 'my-sort-field',
sortDirection: 'asc | desc',
offset: 0, // Offset for starting the page
count: 50 // Number of desired items
});
Frontegg provides a comprehensive REST API for your application. In order to use the API from your backend it is required to initialize the client and the authenticator which maintains the backend to backend session
const authenticator = new FronteggAuthenticator();
await authenticator.init('<YOUR_CLIENT_ID>', '<YOUR_API_KEY>')
// You can optionally set the base url from the HttpClient
const httpClient = new HttpClient(authenticator, { baseURL: 'https://api.frontegg.com' });
await httpClient.post('identity/resources/auth/v1/user', {
email: 'johndoe@acme.com',
password: 'my-super-duper-password'
}, {
// When providing vendor-host, it will replace(<...>) https://<api>.frontegg.com with vendor host
'frontegg-vendor-host': 'acme.frontegg'
});
FAQs
Frontegg Javascript Library for backend node servers
The npm package @frontegg/client receives a total of 15,403 weekly downloads. As such, @frontegg/client popularity was classified as popular.
We found that @frontegg/client demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 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
Opengrep forks Semgrep to preserve open source SAST in response to controversial licensing changes.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.