import React from 'react';
import ReactDOM from 'react-dom'; // For react 17
// For react 18: import ReactDOM from 'react-dom/client';
import App from './App';
import './index.css';
import { FronteggProvider } from '@frontegg/react';
const contextOptions = {
baseUrl: 'https://[YOUR_SUBDOMAIN].frontegg.com',
clientId: '[YOUR-CLIENT-ID]'
};
const authOptions = {
// keepSessionAlive: true // Uncomment this in order to maintain the session alive
};
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { CommonModule } from '@angular/common';
import { FronteggAppModule, FronteggComponent } from '@frontegg/angular';
@NgModule({
declarations: [AppComponent],
imports: [
CommonModule,
BrowserModule,
AppRoutingModule,
/** 1. Import Frontegg Module **/
FronteggAppModule.forRoot(
{
contextOptions: {
baseUrl: 'https://[YOUR-SUB-DOMAIN].frontegg.com',
clientId: '[YOUR-CLIENT-ID]'
},
authOptions: {
// keepSessionAlive: true // Uncomment this in order to maintain the session alive
},
hostedLoginBox: true,
},
),
],
/** 2. Add Frontetgg Component to your entryComponents **/
entryComponents: [FronteggComponent],
bootstrap: [AppComponent],
})
export class AppModule { }
import { createApp } from "vue";
import App from "./App.vue";
import { Frontegg } from "@frontegg/vue";
import { createRouter, createWebHistory } from "vue-router";
const router = createRouter({
history: createWebHistory("/"),
routes: [
{ name: "HomePage", path: "/", component: App },
],
});
const app = createApp(App).use(router);
app.use(Frontegg, {
contextOptions: {
baseUrl: "https://[YOUR_SUBDOMAIN].frontegg.com",
clientId: '[YOUR_CLIENT_ID]'
},
authOptions: {
// keepSessionAlive: true // Uncomment this in order to maintain the session alive
},
hostedLoginBox: true,
router,
});
app.mount("#app");
import {initialize} from "@frontegg/js"
const style = document.createElement('style');
style.setAttribute('type', 'text/css');
style.innerHTML = '';
document.getElementsByTagName('head')[0].appendChild(style);
const app = initialize({
contextOptions: {
baseUrl: "https://YOUR_DOMAIN.frontegg.com", //set your Frontegg environment domain and client ID here
clientId: 'YOUR_FRONTEGG_CLIENT_ID'
},
authOptions: {
// keepSessionAlive: true // Uncomment this in order to maintain the session alive
},
hostedLoginBox: true
})
document.getElementById("loginWithRedirect").addEventListener('click', () => {
app.loginWithRedirect()
})
document.getElementById("logout").addEventListener('click', () => {
app.logout()
})
import { withFronteggApp } from "@frontegg/nextjs/pages";
function CustomApp({ Component, pageProps }: AppProps) {
return ;
}
export default withFronteggApp(CustomApp, {
hostedLoginBox: true,
authOptions: {
// keepSessionAlive: true, // Uncomment this in order to maintain the session alive
},
});