Nuxt quickstart
A Nuxt career site for Northwilds with a list of open jobs, job pages and each job's own application form, sent from Nuxt's server with the Careers SDK.
Tutorial8 min read
In about 15 minutes you build a Nuxt career site for Northwilds that reads its jobs from Careers Orbit. Visitors filter the open jobs, open one, and apply with the job's own form, CV included. Pages render on the server, and three small server routes are the only code that talks to Careers Orbit.
Tested with: Nuxt 4.6.4, Vue 3.5.45, @bifrost-orbit-careers/sdk 0.2.0, Node.js 24.
Before you start
You need:
- At least one published job in Careers Orbit.
- A public key (
careers_pk_…) from API keys. See API keys. - Node.js 20 or later.
1Create the project
npm create nuxt@latest northwilds-careers -- --template minimal --packageManager npm --no-gitInit --no-modulescd northwilds-careersnpm install @bifrost-orbit-careers/sdkDeclare the settings. Replace nuxt.config.ts:
export default defineNuxtConfig({ compatibilityDate: '2025-07-15', runtimeConfig: { careers: { apiUrl: '', publicKey: '', }, },})Nuxt fills them from these environment variables:
NUXT_CAREERS_API_URL=https://api.bifrostorbit.com/careers/v1NUXT_CAREERS_PUBLIC_KEY=careers_pk_...Settings outside runtimeConfig.public stay on the server.
2Add the client
Nuxt makes what server/utils exports available in every server route without an import.
import { createCareersClient, type CareersApplication, type CareersJob } from '@bifrost-orbit-careers/sdk'export function useCareers() { const { careers } = useRuntimeConfig() return createCareersClient({ apiUrl: careers.apiUrl, publicKey: careers.publicKey, locale: 'en' })}export function readApplication(job: CareersJob, form: FormData) { const text = (name: string) => String(form.get(name) ?? '').trim() const file = (name: string) => { const value = form.get(name) return value instanceof File && value.size > 0 ? value : undefined } const field = (name: keyof CareersJob['form']['fields']) => (job.form.fields[name] === 'off' ? undefined : text(name) || null) const answers: NonNullable<CareersApplication['answers']> = {} const questionFiles: Record<string, Blob> = {} for (const question of job.form.questions) { const name = `q-${question.id}` if (question.kind === 'file') { const upload = file(name) if (upload) questionFiles[question.id] = upload } else if (question.kind === 'multiChoice') { answers[question.id] = form.getAll(name).map(String) } else { answers[question.id] = text(name) || null } } const application: CareersApplication = { firstName: text('firstName'), lastName: text('lastName'), email: text('email'), phone: field('phone'), coverLetter: field('coverLetter'), linkedin: field('linkedin'), location: field('location'), salaryExpectation: field('salaryExpectation'), startDate: field('startDate'), answers, privacyVersion: Number(text('privacyVersion')), privacyAccepted: true, source: 'northwilds.com', } return { application, files: { cv: file('cv'), questions: questionFiles } }}useCareersmakes a client with your settings. Every call is made from Nuxt's server.readApplicationturns the posted form into the application the delivery API expects. The form in step 5 names each question's fieldq-and the question's id. Choice answers are option ids, yes or no answers areyesorno, and a question with several choices sends a list.- Standard fields the job has switched off are left out.
privacyVersionis the version of the privacy notice the candidate saw. sourcecounts the application undernorthwilds.comin the reports.
3Add the server routes
import type { CareersJobQuery } from '@bifrost-orbit-careers/sdk'export default defineEventHandler(async (event) => { const careers = useCareers() const query = getQuery(event) as CareersJobQuery const [jobs, filters] = await Promise.all([careers.getJobs(query), careers.getFilters()]) return { jobs, filters }})export default defineEventHandler(async (event) => { const job = await useCareers().findJob(getRouterParam(event, 'slug')!) if (!job) throw createError({ statusCode: 404, statusMessage: 'Job not found' }) return job})import { CareersError } from '@bifrost-orbit-careers/sdk'export default defineEventHandler(async (event) => { const careers = useCareers() const job = await careers.findJob(getRouterParam(event, 'slug')!) if (!job) throw createError({ statusCode: 404, statusMessage: 'Job not found' }) const form = await readFormData(event) if (form.get('privacyAccepted') !== 'on') throw createError({ statusCode: 422, statusMessage: 'Please read and accept the privacy notice.' }) try { const { application, files } = readApplication(job, form) return await careers.apply(job.slug, application, files) } catch (error) { if (error instanceof CareersError) throw createError({ statusCode: error.status, statusMessage: error.message }) throw error }})getJobsanswers the live jobs, newest first, withtotal, and takesq,departmentandlocationfrom the address.getFiltersanswers the departments and locations that have live jobs, with counts.findJobanswersnullfor a job that is closed, scheduled or gone, which becomes a404.- A refused application throws a
CareersErrorwith the status and a message candidates can read, such as "The privacy notice has just changed. Reload the page and read it again." The route passes both on.
4List the jobs
Replace app/app.vue:
<!-- app/app.vue --><template> <header><NuxtLink to="/careers/">Northwilds careers</NuxtLink></header> <main><NuxtPage /></main></template><!-- app/pages/careers/index.vue --><script setup lang="ts">const route = useRoute()const { data } = await useFetch('/api/jobs', { query: computed(() => route.query) })useHead({ title: 'Jobs at Northwilds' })</script><template> <h1>Jobs at Northwilds</h1> <form v-if="data" method="get"> <input name="q" type="search" placeholder="Search" :value="route.query.q ?? ''" /> <select name="department"> <option value="">All departments</option> <option v-for="option in data.filters.departments" :key="option.value" :value="option.value" :selected="route.query.department === option.value"> {{ option.label }} ({{ option.count }}) </option> </select> <select name="location"> <option value="">All locations</option> <option v-for="option in data.filters.locations" :key="option.value" :value="option.value" :selected="route.query.location === option.value"> {{ option.label }} ({{ option.count }}) </option> </select> <button type="submit">Filter</button> </form> <template v-if="data"> <p>{{ data.jobs.total }} {{ data.jobs.total === 1 ? 'job' : 'jobs' }}</p> <ul> <li v-for="job in data.jobs.items" :key="job.id"> <NuxtLink :to="`/careers/${job.slug}/`">{{ job.title }}</NuxtLink> <p>{{ [job.department?.name, job.locations.map((location) => location.city).join(', '), job.employmentTypeLabel, job.remoteLabel].filter(Boolean).join(' · ') }}</p> <p v-if="job.salary">{{ job.salary.text }}</p> </li> </ul> </template></template>The filters are a plain form, so they stay in the address and work without JavaScript.
Check it: run npm run dev and open http://localhost:3000/careers/. You see your open jobs, such as "Mountain guide, Lofoten" with "Guiding · Reine · Temporary · On site". Pick Guiding and select Filter: only the guiding jobs stay.
5Build the application form
Each job has its own form: which standard fields it asks for and its questions. This component draws it and sends it to your server route:
<!-- app/components/ApplyForm.vue --><script setup lang="ts">import type { CareersJob } from '@bifrost-orbit-careers/sdk'const props = defineProps<{ job: CareersJob }>()const standard = [ { name: 'phone', label: 'Phone', type: 'tel' }, { name: 'linkedin', label: 'LinkedIn profile', type: 'url' }, { name: 'location', label: 'Where you live', type: 'text' }, { name: 'salaryExpectation', label: 'Salary expectation', type: 'text' }, { name: 'startDate', label: 'Earliest start date', type: 'date' },] as constconst fields = computed(() => props.job.form.fields)const inputType = { text: 'text', number: 'number', date: 'date', file: 'file' } as Record<string, string>const sending = ref(false)const sent = ref(false)const error = ref('')async function send(event: Event) { sending.value = true error.value = '' try { await $fetch(`/api/jobs/${props.job.slug}/applications`, { method: 'POST', body: new FormData(event.target as HTMLFormElement) }) sent.value = true } catch (caught) { error.value = (caught as { statusMessage?: string }).statusMessage ?? 'Something went wrong. Try again.' } finally { sending.value = false }}</script><template> <p v-if="sent" role="status">Thank you. We have your application and will be in touch.</p> <form v-else @submit.prevent="send"> <h2>Apply for this job</h2> <input type="hidden" name="privacyVersion" :value="job.privacy.version" /> <label>First name <input name="firstName" autocomplete="given-name" required /></label> <label>Last name <input name="lastName" autocomplete="family-name" required /></label> <label>Email <input name="email" type="email" autocomplete="email" required /></label> <template v-for="field in standard" :key="field.name"> <label v-if="fields[field.name] !== 'off'"> {{ field.label }} <input :name="field.name" :type="field.type" :required="fields[field.name] === 'required'" /> </label> </template> <label v-if="fields.cv !== 'off'"> CV (PDF or Word, up to 10 MB) <input name="cv" type="file" accept=".pdf,.doc,.docx" :required="fields.cv === 'required'" /> </label> <label v-if="fields.coverLetter !== 'off'"> Cover letter <textarea name="coverLetter" rows="6" :required="fields.coverLetter === 'required'" /> </label> <template v-for="question in job.form.questions" :key="question.id"> <fieldset v-if="question.kind === 'yesNo'"> <legend>{{ question.label }}</legend> <label><input type="radio" :name="`q-${question.id}`" value="yes" :required="question.required" /> Yes</label> <label><input type="radio" :name="`q-${question.id}`" value="no" /> No</label> </fieldset> <fieldset v-else-if="question.kind === 'choice' || question.kind === 'multiChoice'"> <legend>{{ question.label }}</legend> <label v-for="option in question.options" :key="option.id"> <input :type="question.kind === 'choice' ? 'radio' : 'checkbox'" :name="`q-${question.id}`" :value="option.id" :required="question.required && question.kind === 'choice'" /> {{ option.label }} </label> </fieldset> <label v-else-if="question.kind === 'longText'"> {{ question.label }} <textarea :name="`q-${question.id}`" rows="4" :required="question.required" /> </label> <label v-else> {{ question.label }} <input :name="`q-${question.id}`" :type="inputType[question.kind]" :accept="question.kind === 'file' ? '.pdf,.doc,.docx' : undefined" :required="question.required" /> </label> </template> <p>{{ job.privacy.text }}</p> <label><input type="checkbox" name="privacyAccepted" required /> I have read the privacy notice</label> <p v-if="error" role="alert">{{ error }}</p> <button type="submit" :disabled="sending">Send application</button> </form></template>job.form.fieldssays for each standard field whether it isrequired,optionaloroff.job.form.questionsare the job's questions, with theirkind:text,longText,choice,multiChoice,yesNo,file,dateornumber.- The privacy notice must be shown and accepted. Careers Orbit refuses an application without it.
new FormData(form)sends every field, the CV and any files. CVs are PDF or Word documents up to 10 MB.
6Show a job
<!-- app/pages/careers/[slug].vue --><script setup lang="ts">const route = useRoute()const slug = route.params.slug as stringconst { data: job, error } = await useFetch(`/api/jobs/${slug}`)if (error.value) throw createError({ statusCode: error.value.statusCode ?? 500, statusMessage: error.value.statusMessage, fatal: true })useHead(() => ({ title: job.value?.seo.title, meta: [{ name: 'description', content: job.value?.seo.description }], script: job.value ? [{ type: 'application/ld+json', innerHTML: JSON.stringify(job.value.jobPosting).replace(/</g, '\\u003c') }] : [],}))</script><template> <template v-if="job"> <p><NuxtLink to="/careers/">All jobs</NuxtLink></p> <h1>{{ job.title }}</h1> <p>{{ [job.department?.name, job.locations.map((location) => location.city).join(', '), job.employmentTypeLabel, job.remoteLabel].filter(Boolean).join(' · ') }}</p> <p v-if="job.salary">{{ job.salary.text }}</p> <div v-html="job.description" /> <ApplyForm :job="job" /> </template></template>- The JSON-LD script carries the job's JobPosting data, which Google for Jobs reads.
<keeps a<in the text from closing the script early. descriptionis HTML written in Careers Orbit, cleaned before it is sent.- A job that is gone shows Nuxt's error page with
404.
Check it: open a job, fill in the form with a test CV and select Send application. The form is replaced by "Thank you". In Careers Orbit, the application is in the job's first stage, with the answers and the CV, and its source is northwilds.com.
Next steps
- Show jobs in other languages: Pass
locale: 'de'tocreateCareersClient, or to each call. Text that isn't translated falls back to your main language. - Link candidates' emails to your pages: Set Job addresses under Address and website, such as
https://northwilds.com/careers/{slug}/. - The delivery API: every field, the talent pool and the candidate portal.
- Troubleshooting: what each error means.
Was this page helpful?