tray-scripts-externos

Manage external JavaScript scripts for Tray storefronts via CRUD operations.

14|Updated Mar 21, 2026
One-click install
npx skills add https://github.com/tray-tecnologia/tray-api-claude-plugin --skill tray-scripts-externos
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tray-scripts-externos
Source: https://github.com/tray-tecnologia/tray-api-claude-plugin/tree/main/skills/scripts-externos
Command: npx skills add https://github.com/tray-tecnologia/tray-api-claude-plugin --skill tray-scripts-externos

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Managing custom JavaScript injected into a storefront can be error-prone and harmful to performance or security if scripts are added incorrectly, placed in the wrong location, or use insecure URLs. This Skill centralizes CRUD operations for external scripts so developers can reliably list, add, update, activate/deactivate, and remove injected scripts while following best practices.

Core Features & Use Cases

  • List and Inspect: Retrieve all external scripts and their metadata to audit injected code.
  • Create and Update: Register new external JavaScript snippets or modify existing ones with explicit location (head, body, footer) and activation flags.
  • Activate/Deactivate and Delete: Toggle script activation without deleting, or remove scripts entirely.
  • Use Case: Inject analytics (GTM), marketing pixels, or custom storefront features via HTTPS-hosted scripts placed in the footer for performance.

Quick Start

Add a footer script using the Tray API with URL https://cdn.example.com/gtm.js and set active to 1 using the Script wrapper and your access_token.

Frequently Asked Questions about tray-scripts-externos

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add external JavaScript scripts to a Tray storefront?

To add external JavaScript scripts to a Tray storefront, you create a new script resource using the Tray API with a JSON payload containing the HTTPS script URL, location, and active status. You must provide an access_token and wrap fields under a Script object for authentication and proper registration.

Where can I inject analytics pixels in a Tray storefront?

You can inject analytics pixels in a Tray storefront by specifying the location field as head, body, or footer when creating an external script. Placing analytics scripts in the footer is recommended for storefront performance, while requiring HTTPS URLs ensures secure pixel loading.

Can I deactivate a custom storefront script without deleting it?

Yes, you can deactivate a custom storefront script without deleting it by updating the script resource and setting the active flag to zero. This toggles script activation safely, allowing you to temporarily disable JavaScript snippets like marketing pixels while retaining their configuration for future use.

What is the best way to manage custom storefront JavaScript snippets safely?

The best way to manage custom storefront JavaScript safely is using centralized CRUD operations for external scripts. This approach ensures scripts use HTTPS URLs and are placed in correct locations like head or footer, preventing performance issues and security risks from incorrectly injected code.

How do I list all injected JavaScript snippets on my Tray storefront?

To list all injected JavaScript snippets on a Tray storefront, you retrieve all external scripts and their metadata using the Tray API with your access_token. This audit operation returns every registered script resource, displaying details like URL, location, and activation status for code inspection.

Do I need HTTPS URLs to add external scripts to a Tray storefront?

Yes, you need HTTPS URLs to add external scripts to a Tray storefront because the API enforces secure script sources. Requiring HTTPS URLs for your JavaScript snippets prevents security vulnerabilities and ensures compliance with modern storefront best practices for injected code.