UNPKG

@bolttech/server-side-next

Version:

This library was generated with [Nx](https://nx.dev).

24 lines (23 loc) 1.05 kB
import { NextRequest } from 'next/server'; import { ParamsFromUrlType, QuoteHashFromUrl, RedisSessionData } from '../types/utm.type'; /** * This function captures the UTM params from the url and creates an object * to be used for cookies and/or session. * * @param {NextRequest} req - Request provided by NextJS Middleware * @returns Returns an object that contains the UTM Params for cookies */ export declare const getUtmParamsFromUrl: (req: NextRequest) => ParamsFromUrlType; /** * Returns the H and X params from the URL * @param {NextRequest} req */ export declare const getQuoteHashFromUrl: (req: NextRequest) => QuoteHashFromUrl; /** * Calls a rest api for update the REDIS session with the data captured by the url * @param {NextRequest} request * @param {string} originUrl * @param data * @param {number} currRetryNumber Current retry number */ export declare const updateRedisSession: (request: NextRequest, originUrl: string, data: RedisSessionData, currRetryNumber?: number) => Promise<Response | void>;