# Console Commands

Run these in your browser's developer console (F12 or Cmd+Option+I) to inspect Shoplift's state.

#### Enable debug logging

Turns on verbose console logging for all Shoplift operations. Persists across page loads.

```javascript
// Enable
window.shopliftInstance.setDebug(true);

// Disable
window.shopliftInstance.setDebug(false);
```

#### Dump full internal state

Outputs Shoplift's complete internal state object to the console — useful for support tickets or deep debugging.

```javascript
window.shopliftInstance.debug();
```

#### Check if Shoplift is loaded

```javascript
console.log(window.shoplift);
// Should log an object with isHypothesisActive, setAnalyticsConsent, getVisitorData
```

#### Inspect visitor data

```javascript
const data = window.shoplift.getVisitorData();
console.log('Visitor:', data.visitor);
console.log('Tests:', data.visitorTests);
```

#### View visitor data as a table

```javascript
console.table(window.shoplift.getVisitorData().visitor);
```

#### List all active test assignments

```javascript
window.shoplift.getVisitorData().visitorTests.forEach((t) => {
  console.log(`${t.testId} → ${t.hypothesisId} (${t.isThemeTest ? 'theme' : 'element'})`);
});
```

#### Test a specific hypothesis

```javascript
const result = await window.shoplift.isHypothesisActive('your-hypothesis-id');
console.log('In variant:', result);
```

#### Check consent state

```javascript
const data = window.shoplift.getVisitorData();
console.log('Visitor exists:', !!data.visitor);
console.log('Tests tracked:', data.visitorTests.length);
```
