nNexGateHub
Browse NexGateHub
NEXGATEHUB / PROMPTS

AI prompt library — page 221

Discover, adapt and reuse 23,385 prompts. Copy, adapt, and create.

22149 English prompts · Page 221 of 231

Workflows · EN

CORRECT AUTH GUARD IMPLEMENTATION

// src/lib/guards/auth.ts import { browser } from '$app/environment' import { goto } from '$app/navigation' import { user } from '$lib/stores/supabase' import type { Load } from '@sveltejs/kit' export const authGuard: L

Workflows · EN

CORRECT AUTH STATE HANDLING

import { useAuth0 } from '@auth0/auth0-react'; export function AuthenticatedComponent() { const { isAuthenticated, user, isLoading } = useAuth0(); if (isLoading) { return Loading... ; } if (!isAuthenticated) { r

Workflows · EN

CORRECT AUTH STATE HANDLING

import { useAuth, useUser } from '@clerk/clerk-react'; export function AuthenticatedComponent() { const { isLoaded, userId } = useAuth(); const { user } = useUser(); if (!isLoaded) { return Loading... ; } if (!u

Workflows · EN

CORRECT AUTH0 PROVIDER IMPLEMENTATION

import { Auth0Provider } from '@auth0/auth0-react'; import { env } from './env.ts'; export function Providers({ children }: { children: React.ReactNode }) { return ( <Auth0Provider domain={env.AUTH0DOMAIN} clientId=

Workflows · EN

Correct Authentication Components

// auth.component.ts import { Component } from '@angular/core'; import { ClerkService } from 'ngx-clerk'; @Component({ selector: 'app-auth', template: Welcome, {{ user.firstName }} Sign Out }) export

Workflows · EN

Correct Authentication Components

// src/pages/auth.astro import { SignIn, SignUp, UserButton } from '@clerk/astro' import { getAuth } from '@clerk/astro/server' const { userId } = await getAuth(Astro) {userId ? ( Welcome back! ) : ( )}

Workflows · EN

Correct Authentication Components

// src/components/auth.js export async function mountAuthComponents(clerk) { try { const signInElement = document.getElementById('sign-in'); const userButtonElement = document.getElementById('user-button'); if (sign

Workflows · EN

Correct Authentication Components

// routes/auth.tsx import { SignIn, SignUp, UserButton } from '@clerk/remix' import { useUser } from '@clerk/remix' export default function Auth() { const { isSignedIn, user } = useUser() return ( {isSignedIn ? (

Workflows · EN

CORRECT AUTHENTICATION HOOKS

// src/hooks/useAuthQuery.js import { useAuth0 } from '@auth0/auth0-react'; import { useQuery } from '@tanstack/react-query'; export function useAuthQuery(queryKey, queryFn, options = {}) { const { getAccessTokenSilent

Workflows · EN

CORRECT AUTHENTICATION HOOKS

// src/hooks/useAuthQuery.js import { useAuth } from 'better-auth'; import { useQuery } from '@tanstack/react-query'; export function useAuthQuery(queryKey, queryFn, options = {}) { const { getToken, isAuthenticated }

Workflows · EN

CORRECT AUTHENTICATION HOOKS

// src/hooks/useAuthQuery.js import { useAuth } from '@clerk/clerk-react'; import { useQuery } from '@tanstack/react-query'; export function useAuthQuery(queryKey, queryFn, options = {}) { const { getToken, isSignedIn

Workflows · EN

CORRECT CLIENT IMPLEMENTATION

import { createClient } from '@supabase/supabase-js' const supabaseUrl = import.meta.env.VITESUPABASEURL const supabaseAnonKey = import.meta.env.VITESUPABASEANONKEY export const supabase = createClient(supabaseUrl, sup

Workflows · EN

CORRECT CLIENT INITIALIZATION

import { initializeClerkClient } from 'clerk-sveltekit/client'; import { PUBLICCLERKPUBLISHABLEKEY } from '$env/static/public'; initializeClerkClient(PUBLICCLERKPUBLISHABLEKEY, { afterSignInUrl: '/dashboard', afterSig

Workflows · EN

Correct Client Integration

// app/lib/auth.client.ts import { createClient } from 'better-auth/client' import type { User } from '~/types' export const authClient = createClient ({ apiUrl: '/api/auth', onSessionChange: session = { console.log(

Workflows · EN

CORRECT COMPONENT USAGE

import SignIn from 'clerk-sveltekit/client/SignIn.svelte'; import SignUp from 'clerk-sveltekit/client/SignUp.svelte'; import UserButton from 'clerk-sveltekit/client/UserButton.svelte';

Workflows · EN

CORRECT COMPONENT USAGE

// src/routes/dashboard/+page.server.ts import { redirect } from '@sveltejs/kit'; import type { PageServerLoad } from './$types'; export const load: PageServerLoad = async ({ locals }) = { const { userId } = locals.cle

Workflows · EN

Correct Configuration Setup

// astro.config.mjs import { defineConfig } from 'astro/config' import clerk from '@clerk/astro' export default defineConfig({ integrations: [clerk()], output: 'server' }) // src/middleware.ts import { clerkMiddlewar

Workflows · EN

Correct Initialization

// app.config.ts import { ApplicationConfig } from '@angular/core'; import { provideClerk } from 'ngx-clerk'; export const appConfig: ApplicationConfig = { providers: [ provideClerk({ publishableKey: environment.cler

Workflows · EN

Correct Initialization Setup

// src/auth.js import Clerk from '@clerk/clerk-js'; export async function initClerk() { try { const clerk = new Clerk(import.meta.env.VITECLERKPUBLISHABLEKEY); await clerk.load(); return clerk; } catch (error) { c

Workflows · EN

CORRECT JAVASCRIPT IMPLEMENTATION

// auth.js class BetterAuthHandler { constructor(config) { this.config = config; this.auth = null; } async initialize() { try { const { createAuthClient } = await import('better-auth'); this.auth = createAuthCl

Workflows · EN

Correct Module Configuration

// app.config.ts import { ApplicationConfig } from '@angular/core'; import { provideAuth0 } from '@auth0/auth0-angular'; import { environment } from './environments/environment'; export const appConfig: ApplicationConfi

Workflows · EN

Correct Module Setup

// app.module.ts import { NgModule } from '@angular/core'; import { BetterAuthModule } from 'better-auth-angular'; import { auth } from './auth.config'; @NgModule({ imports: [ BetterAuthModule.forRoot(auth, { persist

Workflows · EN

CORRECT PACKAGE SETUP

{ "dependencies": { "@auth0/auth0-react": "^2.0.0", "@tanstack/react-query": "^5.0.0", "@tanstack/react-query-devtools": "^5.0.0", "@tanstack/react-router": "^1.0.0", "react": "^18.0.0", "react-dom": "^18.0.0" }

Workflows · EN

CORRECT PACKAGE SETUP

{ "dependencies": { "better-auth": "^2.0.0", "@tanstack/react-query": "^5.0.0", "@tanstack/react-query-devtools": "^5.0.0", "@tanstack/react-router": "^1.0.0", "react": "^18.0.0", "react-dom": "^18.0.0" } }

Workflows · EN

CORRECT PACKAGE SETUP

{ "dependencies": { "@clerk/clerk-react": "^4.0.0", "@tanstack/react-query": "^5.0.0", "@tanstack/react-query-devtools": "^5.0.0", "react": "^18.0.0", "react-dom": "^18.0.0" } }

Workflows · EN

CORRECT PACKAGE SETUP

{ "dependencies": { "@supabase/supabase-js": "^2.0.0", "@supabase/ssr": "^2.0.0", "@supabase-cache-helpers/postgrest-react-query": "^1.0.0", "@tanstack/react-query": "^5.0.0", "@tanstack/react-query-devtools": "^5.

Workflows · EN

Correct Plugin Implementation

import { createApp } from 'vue' import { createAuth0 } from '@auth0/auth0-vue' import App from './App.vue' const app = createApp(App) app.use( createAuth0({ domain: import.meta.env.VITEAUTH0DOMAIN, clientId: import.

Workflows · EN

Correct Plugin Implementation

import { createApp } from 'vue' import App from './App.vue' import { clerkPlugin } from 'vue-clerk' const PUBLISHABLEKEY = import.meta.env.VITECLERKPUBLISHABLEKEY if (!PUBLISHABLEKEY) { throw new Error('Missing Publish

Workflows · EN

CORRECT PROTECTED ROUTE IMPLEMENTATION

import { useAuth0 } from '@auth0/auth0-react'; import { Navigate } from 'react-router-dom'; export function ProtectedRoute({ children }: { children: React.ReactNode }) { const { isAuthenticated, isLoading } = useAuth0(

Workflows · EN

CORRECT PROTECTED ROUTE IMPLEMENTATION

import { Navigate } from 'react-router-dom' import { useAuth } from './AuthProvider' export function ProtectedRoute({ children }: { children: React.ReactNode }) { const { user, loading } = useAuth() if (loading) { r

Workflows · EN

CORRECT PROTECTED ROUTES

// src/routes/protected.jsx import { createFileRoute, redirect } from '@tanstack/react-router'; export const Route = createFileRoute('/protected')({ beforeLoad: ({ context }) = { if (!context.auth.isAuthenticated) {

Workflows · EN

CORRECT PROTECTED ROUTES

// src/routes/protected.jsx import { createFileRoute, redirect } from '@tanstack/react-router'; export const Route = createFileRoute('/protected')({ beforeLoad: ({ context }) = { if (!context.auth.isAuthenticated) {

Workflows · EN

CORRECT PROVIDER SETUP

// src/App.jsx import { Auth0Provider } from '@auth0/auth0-react'; import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import { ReactQueryDevtools } from '@tanstack/react-query-devtools'; import { R

Workflows · EN

CORRECT PROVIDER SETUP

// src/App.jsx import { createAuthClient, AuthProvider } from 'better-auth'; import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import { ReactQueryDevtools } from '@tanstack/react-query-devtools';

Workflows · EN

CORRECT PROVIDER SETUP

// src/App.jsx import { ClerkProvider } from '@clerk/clerk-react'; import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import { ReactQueryDevtools } from '@tanstack/react-query-devtools'; const que

Workflows · EN

CORRECT PROVIDER SETUP

// src/App.jsx import { createBrowserClient } from '@supabase/ssr'; import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import { ReactQueryDevtools } from '@tanstack/react-query-devtools'; import {

Workflows · EN

Correct Root Component Setup

// app.component.ts import { Component } from '@angular/core'; import { ClerkService } from 'ngx-clerk'; @Component({ selector: 'app-root', standalone: true, template: ' ' }) export class AppComponent { constructor(

Workflows · EN

Correct Root Configuration

// root.tsx import { rootAuthLoader } from '@clerk/remix/ssr.server' import { ClerkApp } from '@clerk/remix' import type { LoaderFunction } from '@remix-run/node' export const loader: LoaderFunction = args = rootAuthLoa

Workflows · EN

CORRECT USAGE WITH TANSTACK ROUTER

// src/routes/root.jsx import { createRootRouteWithContext } from '@tanstack/react-router'; import { AuthContextInterface } from 'better-auth'; interface RouterContext { auth: AuthContextInterface; } export const Rout

Workflows · EN

Create a Browser Client

// lib/supabase-browser.ts import { createBrowserClient } from "@supabase/ssr"; export function createClient() { return createBrowserClient( process.env.NEXTPUBLICSUPABASEURL!, process.env.NEXTPUBLICSUPABASEANONKEY!

Workflows · EN

Create a Professional Bio

Write a GitHub Sponsors bio for my profile that highlights my experience in [your field], the impact of my open source work, and my commitment to community growth.

Workflows · EN

Create a Scene in Three

Create a scene in three.js. It will be a museum with paintings on the walls, and you can walk around the museum hall like in a game. Make the walls and floor white. There will be glass on the ceiling with the sky visible

Workflows · EN

Create a Server Client

// lib/supabase-server.ts import { createServerClient } from "@supabase/ssr"; import { cookies } from "next/headers"; export function createServerSupabaseClient() { const cookieStore = cookies(); return createServerC

Workflows · EN

Create a Video with Top Athletes

Act as a Sports Video Editor. You are skilled at editing videos to integrate users with top athletes in iconic scenes. Your task is to add the user into the uploaded video with a famous athlete, ensuring a seamless and e

Workflows · EN

Create Campaigns Using AI

Create a marketing campaign focusing on [ideal customer persona] considering psychological reactance. Emphasize the freedom offered by [product/service] and avoid controlling language or offers. Product = [Insert here]

Workflows · EN

Create Claude Prompts Using Claude

You are the manager of employees who are experts in [skills]. You recently came across Claude, which can answer anything with the right prompt. You understand Claude's limitations and how to explain the prompt in detail.

Workflows · EN

Create Claude Prompts Using Claude

Create Claude Prompts using Claude You are the manager of employees who are experts in [skills]. You recently came across Claude, which can answer anything with the right prompt. You understand Claude's limitations and

Workflows · EN

Create Guest Lectures Using AI

Listen carefully, I'm a marketing professor at the Stanford Graduate School of Business. This Monday, I'm going to a marketing agency full of marketing and sales enthusiasts to give a guest lecture. I have a time limit

Workflows · EN

Create Impactful Marketing Campaigns

I want you to act as an advertiser. You will create a campaign to promote a product or service of your choice. You will choose a target audience, develop key messages and slogans, select the media channels for promotion,

Workflows · EN

Create Impactful Marketing Campaigns

Create impactful marketing campaigns I want you to act as an advertiser. You will create a campaign to promote a product or service of your choice. You will choose a target audience, develop key messages and slogans, se

Workflows · EN

Create Interview Challenges Using AI

Create 3 rounds of challenges to compile the best candidates for [role] and make sure to solve the challenges participants should have the deep knowledge required for the [role] and [abilities]. Create unique novel chall

Workflows · EN

Create Marketing Strategies Using AI

Write out a marketing strategy for a new startup that is selling [product]. I have about a [available budget] marketing budget and need to reach [target audience]. Provide detailed examples of a comprehensive strategy,

Workflows · EN

Create Metaphors Using Claude

Suggest 20 metaphors to describe the benefits of [Insert product/service], make them short no more than 6 words and use friendly tone and must include novelty. Product: [Insert here]

Workflows · EN

Create Taglines for Your Product

Develop 10 taglines for [product/business] that effectively convey the [product/business]'s mission and inspire others to become a part of it. Taglines should be short and snappy. Product = [Insert here]

Workflows · EN

Create Tests

Create two [ define technology ] tests for the above 'tempFunction' function. One that is expected to pass and one that is expected to fail.

Workflows · EN

Create Tests

5. Create Tests Create some simple tests that we can run locally and validate the results Prompt: Create two [ define technology ] tests for the above 'tempFunction' function. One that is expected to pass and one that