Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.PHONY: build test test-coverage coverage-report test-love clean install install-teal docs install-love2d ci-love2d test-rockspec test-rockspec-clean publish
.PHONY: build test test-coverage coverage-report test-love clean install install-teal docs install-love2d ci-love2d test-rockspec test-rockspec-clean publish roblox-all-in-one

# Install Teal compiler (for fresh systems without Teal)
install-teal:
Expand Down Expand Up @@ -311,3 +311,10 @@ publish: build
@echo "Package contents:"
@unzip -l sentry-lua-sdk-publish.zip

# Validate Roblox all-in-one integration file
roblox-all-in-one: build
@echo "Validating Roblox all-in-one integration..."
@./scripts/generate-roblox-all-in-one.sh
@echo "✅ Validated examples/roblox/sentry-all-in-one.lua"
@echo "📋 This file contains the complete SDK and can be copy-pasted into Roblox Studio"

104 changes: 104 additions & 0 deletions examples/roblox/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
# Roblox Sentry Integration

Example Sentry integration for Roblox games.

## 🚀 Quick Start

**Use the all-in-one file:**

1. **Copy** `sentry-all-in-one.lua`
2. **Paste** into ServerScriptService as a Script
3. **Update DSN** on line 18
4. **Enable HTTP**: Game Settings → Security → "Allow HTTP Requests"
5. **Run** the game (F5)

## 📁 Available Files

- **`sentry-all-in-one.lua`** ⭐ **Complete single-file solution**
- **`sentry-roblox-sdk.lua`** - Reusable SDK module
- **`clean-example.lua`** - Example using the SDK module

## 🧪 Testing

Use the standard Sentry API (same as other platforms):

```lua
-- Capture events
sentry.capture_message("Hello Sentry!", "info")
sentry.capture_exception({type = "TestError", message = "Something failed"})

-- Set context
sentry.set_user({id = "123", username = "Player1"})
sentry.set_tag("level", "5")
sentry.add_breadcrumb({message = "Player moved", category = "navigation"})
```

## ✅ Success Indicators

Your integration is working when you see:

1. **Console Output**:
```
✅ Event sent successfully!
📊 Response: {"id":"..."}
```

2. **Sentry Dashboard**: Events appear within 30 seconds

3. **Manual Commands Work**: `sentry.capture_message("test")` executes without errors

## 🛠️ Customization

```lua
-- Required: Update your DSN
local SENTRY_DSN = "https://your-key@your-org.ingest.sentry.io/your-project-id"

-- Optional: Customize environment and release
sentry.init({
dsn = SENTRY_DSN,
environment = "production", -- or "staging", "development"
release = "1.2.0" -- your game version
})

-- Add user context
sentry.set_user({
id = tostring(player.UserId),
username = player.Name
})

-- Add custom tags and breadcrumbs
sentry.set_tag("game_mode", "survival")
sentry.add_breadcrumb({
message = "Player entered dungeon",
category = "game_event"
})
```

## 🐛 Troubleshooting

**"HTTP requests not enabled"**
→ Game Settings → Security → ✅ "Allow HTTP Requests"

**No events in Sentry dashboard**
→ Wait 10-30 seconds, check correct project, verify DSN

**"attempt to index nil with 'capture_message'"**
→ Make sure sentry.init() was called successfully first

## 🔨 Validation

To validate the Roblox integration is ready:

```bash
make roblox-all-in-one
# or directly:
./scripts/generate-roblox-all-in-one.sh
```

This checks that the `sentry-all-in-one.lua` file contains all required components and uses the standard SDK API.

## 🎉 Ready to Go!

Use `sentry-all-in-one.lua` to get started immediately. Copy, paste, update DSN, and test!

**Happy debugging with Sentry! 🐛→✅**
Loading
Loading