MCPcopy Create free account
hub / github.com/dailydotdev/apps / getBootURL

Function getBootURL

packages/shared/src/lib/boot.ts:118–143  ·  view source on GitHub ↗
(
  app: string,
  url?: string,
  pathname?: string,
  featuresVersion?: string,
)

Source from the content-addressed store, hash-verified

116};
117
118const getBootURL = (
119 app: string,
120 url?: string,
121 pathname?: string,
122 featuresVersion?: string,
123) => {
124 const appRoute = app === 'companion' ? '/companion' : '';
125 const params = new URLSearchParams();
126 if (process.env.CURRENT_VERSION) {
127 params.append('v', process.env.CURRENT_VERSION);
128 }
129 if (featuresVersion) {
130 params.append('fv', featuresVersion);
131 }
132 if (url) {
133 params.append('url', url);
134 }
135 const referrer = getReferrerType(pathname);
136 if (referrer) {
137 params.append('referrer', referrer);
138 }
139 // EngagementAdsProvider fetches the creatives once boot lands
140 params.append('engagement', 'lazy');
141
142 return `${apiUrl}/boot${appRoute}?${params}`;
143};
144
145const enrichBootWithFeatures = async (boot: Boot): Promise<Boot> => {
146 if (!boot.exp?.f || !process.env.NEXT_PUBLIC_EXPERIMENTATION_KEY) {

Callers 1

getBootDataFunction · 0.85

Calls 1

getReferrerTypeFunction · 0.85

Tested by

no test coverage detected