
Research
Malicious npm Package Brand-Squats TanStack to Exfiltrate Environment Variables
A brand-squatted TanStack npm package used postinstall scripts to steal .env files and exfiltrate developer secrets to an attacker-controlled endpoint.
@foursquare/pilgrim-sdk-react-native
Advanced tools
Install module
npm
npm install @foursquare/pilgrim-sdk-react-native
Yarn
yarn add @foursquare/pilgrim-sdk-react-native
Link native code
With autolinking (react-native 0.60+)
cd ios && pod install && cd ..
Pre 0.60
react-native link @foursquare/pilgrim-sdk-react-native
You must call [[FSQPPilgrimManager sharedManager] configureWithConsumerKey:secret:delegate:completion:] from application:didFinishLaunchingWithOptions in a your application delegate, for example:
// AppDelegate.m
#import "AppDelegate.h"
#import <React/RCTBridge.h>
#import <React/RCTBundleURLProvider.h>
#import <React/RCTRootView.h>
#import <Pilgrim/Pilgrim.h>
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
[[FSQPPilgrimManager sharedManager] configureWithConsumerKey:@"CONSUMER_KEY"
secret:@"CONSUMER_SECRET"
delegate:nil
completion:nil];
// Other react native initialization code
return YES;
}
...
@end
You must call PilgrimSdk.with(PilgrimSdk.Builder) from onCreate in a your android.app.Application subclass, for example:
// MainApplication.java
import android.app.Application;
import com.facebook.react.ReactApplication;
import com.foursquare.pilgrim.PilgrimSdk;
public class MainApplication extends Application implements ReactApplication {
@Override
public void onCreate() {
super.onCreate();
PilgrimSdk.Builder builder = new PilgrimSdk.Builder(this)
.consumer("CONSUMER_KEY", "CONSUMER_SECRET")
.enableDebugLogs();
PilgrimSdk.with(builder);
// Other react native initialization code
}
...
}
import React, { Component } from 'react';
import { Text } from 'react-native';
import PilgrimSdk from '@foursquare/pilgrim-sdk-react-native';
export default class Screen extends Component {
state = {
installId: "-",
};
componentDidMount() {
PilgrimSdk.getInstallId().then(installId => {
this.setState({ installId: installId });
});
}
render() {
return (
<>
<Text>Install ID: {this.state.installId}</Text>
</>
);
}
}
You can actively request the current location of the user by calling the PilgrimSdk.getCurrentLocation method. The return value will be a Promise<CurrentLocation>. The CurrentLocation object has the current venue the device is most likely at as well as any geofences that the device is in (if configured). More information here. Example usage below:
import React, { Component } from 'react';
import { Alert, Text } from 'react-native';
import PilgrimSdk from '@foursquare/pilgrim-sdk-react-native';
export default class Screen extends Component {
state = {
currentLocation: null
};
getCurrentLocation = async function () {
try {
const currentLocation = await PilgrimSdk.getCurrentLocation();
this.setState({ currentLocation: currentLocation });
} catch (e) {
Alert.alert("Pilgrim SDK", `${e}`);
}
}
componentDidMount() {
this.getCurrentLocation();
}
render() {
if (this.state.currentLocation != null) {
const venue = this.state.currentLocation.currentPlace.venue;
const venueName = venue.name || "Unnamed venue";
return (
<>
<Text>Venue: {venueName}</Text>
</>
);
} else {
return (
<>
<Text>Loading...</Text>
</>
);
}
}
}
Passive location detection is controlled with the PilgrimSdk.start and PilgrimSdk.stop methods. When started Pilgrim SDK will send notifications to Webhooks and other third-party integrations. Example usage below:
import React, { Component } from 'react';
import { Alert, Button } from 'react-native';
import PilgrimSdk from '@foursquare/pilgrim-sdk-react-native';
export default class Screen extends Component {
startPilgrim = async function () {
const canEnable = await PilgrimSdk.canEnable();
const isSupportedDevice = await PilgrimSdk.isSupportedDevice();
if (canEnable && isSupportedDevice) {
PilgrimSdk.start();
Alert.alert("Pilrim SDK", "Pilgrim started");
} else {
Alert.alert("Pilrim SDK", "Error starting");
}
}
stopPilgrim = function () {
PilgrimSdk.stop();
Alert.alert("Pilrim SDK", "Pilgrim stopped");
}
render() {
return (
<>
<Button title="Start" onPress={() => { this.startPilgrim(); }} />
<Button title="Stop" onPress={() => { this.stopPilgrim(); }} />
</>
);
}
}
The debug screen is shown using the PilgrimSdk.showDebugScreen method. This screen contains logs sent from Pilgrim SDK and other debugging tools/information. Example usage below:
import React, { Component } from 'react';
import { Button } from 'react-native';
import PilgrimSdk from '@foursquare/pilgrim-sdk-react-native';
export default class Screen extends Component {
showDebugScreen = function () {
PilgrimSdk.showDebugScreen();
}
render() {
return (
<>
<Button title="Show Debug Screen" onPress={() => { this.showDebugScreen(); }} />
</>
);
}
}
Test arrival visits can be fired with the method PilgrimSdk.fireTestVisit. You must pass a location to be used for the test visit. The arrival notification will be received via Webhooks and other third-party integrations
import React, { Component } from 'react';
import { Button } from 'react-native';
import PilgrimSdk from '@foursquare/pilgrim-sdk-react-native';
export default class Screen extends Component {
fireTestVisit = async function () {
navigator.geolocation.getCurrentPosition((position) => {
const latitude = position.coords.latitude;
const longitude = position.coords.longitude;
PilgrimSdk.fireTestVisit(latitude, longitude);
Alert.alert("Pilgrim SDK", `Sent test visit with location: (${latitude},${longitude})`);
}, err => {
Alert.alert("Pilgrim SDK", `${err}`);
});
}
render() {
return (
<>
<Button title="Fire Test Visit" onPress={() => { this.fireTestVisit(); }} />
</>
);
}
}
Consult the Pilgrim documentation here
FAQs
React native wrapper for the Pilgrim SDK
The npm package @foursquare/pilgrim-sdk-react-native receives a total of 24 weekly downloads. As such, @foursquare/pilgrim-sdk-react-native popularity was classified as not popular.
We found that @foursquare/pilgrim-sdk-react-native demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
A brand-squatted TanStack npm package used postinstall scripts to steal .env files and exfiltrate developer secrets to an attacker-controlled endpoint.

Research
Compromised SAP CAP npm packages download and execute unverified binaries, creating urgent supply chain risk for affected developers and CI/CD environments.

Company News
Socket has acquired Secure Annex to expand extension security across browsers, IDEs, and AI tools.