Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@ninetailed/client-sdk-nextjs

Package Overview
Dependencies
Maintainers
1
Versions
59
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ninetailed/client-sdk-nextjs - npm Package Compare versions

Comparing version 0.3.0 to 0.4.0

lib/utils/absolute-url.d.ts

24

client-sdk-nextjs.esm.js

@@ -89,4 +89,24 @@ import { v4 } from 'uuid';

function absoluteUrl(req) {
var localhostAddress = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'localhost:3000';
var host = (req !== null && req !== void 0 && req.headers ? req.headers.host : window.location.host) || localhostAddress;
var protocol = /^localhost(:\d+)?$/.test(host) ? 'http:' : 'https:';
if (req && req.headers['x-forwarded-host'] && typeof req.headers['x-forwarded-host'] === 'string') {
host = req.headers['x-forwarded-host'];
}
if (req && req.headers['x-forwarded-proto'] && typeof req.headers['x-forwarded-proto'] === 'string') {
protocol = "".concat(req.headers['x-forwarded-proto'], ":");
}
return {
protocol: protocol,
host: host,
origin: protocol + '//' + host
};
}
var buildSSRCampaign = function buildSSRCampaign(ctx) {
var query = buildQuery(new URL(ctx.req.url, ctx.req.headers.host).toString());
var query = buildQuery(new URL(ctx.req.url, absoluteUrl(ctx.req).origin).toString());
return buildCampaign(query);

@@ -96,3 +116,3 @@ };

var buildSSRPage = function buildSSRPage(ctx) {
var url = new URL(ctx.req.url, ctx.req.headers.host);
var url = new URL(ctx.req.url, absoluteUrl(ctx.req).origin);
return {

@@ -99,0 +119,0 @@ path: url.pathname,

@@ -56,4 +56,24 @@ (function (global, factory) {

function absoluteUrl(req) {
var localhostAddress = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'localhost:3000';
var host = (req !== null && req !== void 0 && req.headers ? req.headers.host : window.location.host) || localhostAddress;
var protocol = /^localhost(:\d+)?$/.test(host) ? 'http:' : 'https:';
if (req && req.headers['x-forwarded-host'] && typeof req.headers['x-forwarded-host'] === 'string') {
host = req.headers['x-forwarded-host'];
}
if (req && req.headers['x-forwarded-proto'] && typeof req.headers['x-forwarded-proto'] === 'string') {
protocol = "".concat(req.headers['x-forwarded-proto'], ":");
}
return {
protocol: protocol,
host: host,
origin: protocol + '//' + host
};
}
var buildSSRCampaign = function buildSSRCampaign(ctx) {
var query = clientSdkCore.buildQuery(new URL(ctx.req.url, ctx.req.headers.host).toString());
var query = clientSdkCore.buildQuery(new URL(ctx.req.url, absoluteUrl(ctx.req).origin).toString());
return clientSdkCore.buildCampaign(query);

@@ -63,3 +83,3 @@ };

var buildSSRPage = function buildSSRPage(ctx) {
var url = new URL(ctx.req.url, ctx.req.headers.host);
var url = new URL(ctx.req.url, absoluteUrl(ctx.req).origin);
return {

@@ -66,0 +86,0 @@ path: url.pathname,

2

package.json
{
"name": "@ninetailed/client-sdk-nextjs",
"version": "0.3.0",
"version": "0.4.0",
"main": "./client-sdk-nextjs.umd.js",

@@ -5,0 +5,0 @@ "module": "./client-sdk-nextjs.esm.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc