• Blog
  • Docs
  • Pricing
  • We’re hiring!
Log inSign up
dcm31

dcm31

logoWorkshopOpenMoji

Project created from val URLs
Public
Like
logoWorkshopOpenMoji
Home
Code
20
API_DOCS.md
ColorPicker.tsx
ColorUtils.tsx
EmojiColorHandler.tsx
EmojiUtils.tsx
FontData.tsx
LogoGenerator.tsx
LogoPreview.tsx
SDK_README.md
SvgHostClient.tsx
TextEditor.tsx
TextSizing.tsx
H
api.tsx
example.tsx
H
index.new.tsx
index.sdk.tsx
H
index.tsx
sdk.tsx
zLogoGenerator.tsx
zTextSizing.tsx
Branches
5
Pull requests
5
Remixes
1
History
Environment variables
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Sign up now
Code
/
SDK_README.md
Code
/
SDK_README.md
Search
4/17/2025
SDK_README.md

LogoWorkshopOpenMoji SDK

This SDK provides direct programmatic access to the LogoWorkshopOpenMoji logo generation engine. Rather than making HTTP API calls, you can use this SDK to generate logos directly in your code.

Installation/Import

Import the SDK directly from Val Town:

// Import the default SDK constructor import LogoWorkshopSDK from "https://esm.town/v/dcm31/logoWorkshopOpenMoji/sdk.tsx"; // Or import the pre-configured instance import { logoWorkshopSDK } from "https://esm.town/v/dcm31/logoWorkshopOpenMoji/sdk.tsx"; // Or import everything import LogoWorkshopSDK, { logoWorkshopSDK, LogoGeneratorOptions } from "https://esm.town/v/dcm31/logoWorkshopOpenMoji/sdk.tsx";

Basic Usage

// Use the pre-configured instance import { logoWorkshopSDK } from "https://esm.town/v/dcm31/logoWorkshopOpenMoji/sdk.tsx"; // Generate a simple logo const result = await logoWorkshopSDK.generateLogo({ words: "Developer Hub", emoji: "πŸ‘¨β€πŸ’»" }); // The SVG string is available in result.svg console.log(result.svg); // Metadata about the logo is available in result.meta console.log(`Font sizes: ${result.meta.topFontSize}px and ${result.meta.bottomFontSize}px`);

Shorthand for SVG Only

If you only need the SVG output:

const svgString = await logoWorkshopSDK.generateLogoSvg({ words: "Developer Hub", emoji: "πŸ‘¨β€πŸ’»" }); console.log(svgString);

Creating a Custom Instance

You can create your own instance with custom settings:

import LogoWorkshopSDK from "https://esm.town/v/dcm31/logoWorkshopOpenMoji/sdk.tsx"; // Create instance with custom emoji service URL const mySDK = new LogoWorkshopSDK("https://my-custom-emoji-service.example.com"); const result = await mySDK.generateLogo({ // options });

Configuration Options

The SDK accepts the same options as the HTTP API:

type LogoGeneratorOptions = { // Required parameters (at least one of these) firstPart?: string; // Text for top line or full text in single line mode lastPart?: string; // Text for bottom line (ignored in single line mode) words?: string; // All text (will be split automatically) // Display options auto?: boolean; // Auto determine mode based on length (default: true) singleLine?: boolean; // Force single line mode (default: auto-determined) // Text styling fontFamily?: string; // Font family (default: "Arial, sans-serif") textColor?: string; // Hex color for text (default: "#000000") accentColor?: string; // Hex color for accents (default: "#ea5a47") secondaryColor?: string; // Hex color for bottom strip (default: "#781e32") bgColor?: string; // Hex color for background (default: "#ffffff") boldTop?: boolean; // Bold for top line (default: true) italicTop?: boolean; // Italic for top line (default: false) boldBottom?: boolean; // Bold for bottom line (default: true) italicBottom?: boolean; // Italic for bottom line (default: false) // Layout and positioning emojiX?: number; // X position for emoji (default: 140) emojiY?: number; // Y position for emoji (default: 13.5) emojiScale?: number; // Scale factor for emoji (default: 0.71) verticalSpacingFactor?: number; // Line spacing (default: -0.25) // Special features emoji?: string; // Emoji character to use debug?: boolean; // Show guide lines (default: false) // Emoji auto-generation useEmojiSdk?: boolean; // Use emoji generator if none specified (default: true) emojiSdkUrl?: string; // Custom emoji service URL };

Response Structure

The generateLogo() method returns a promise that resolves to:

type LogoGeneratorResult = { svg: string; // The complete SVG string meta: { // Font sizes topFontSize: number; bottomFontSize: number; // Positioning topY: number; bottomY: number; textXPosition: number; maxWidth: number; actualWidth: number; // Mode settings singleLineMode: boolean; autoMode: boolean; // Text content originalWords: string; firstPart: string; lastPart: string; totalCharCount: number; characterThreshold: number; // Text styling isBoldTop: boolean; isItalicTop: boolean; isBoldBottom: boolean; isItalicBottom: boolean; // Emoji details emoji: string; emojiCodepoint: string; emojiX: number; emojiY: number; emojiScale: number; // Spacing details spacing: number; verticalSpacingFactor: number; yOffset: number; // Colors extractedColors: string[]; colors: { textColor: string; accentColor: string; secondaryColor: string; bgColor: string; }; // Additional info usedEmojiSdk: boolean; }; };

Examples

Basic Two-Line Logo

const result = await logoWorkshopSDK.generateLogo({ firstPart: "CLOUD", lastPart: "COMPUTING", emoji: "☁️" });

Single-Line Mode

const result = await logoWorkshopSDK.generateLogo({ words: "DevHub", emoji: "πŸ‘¨β€πŸ’»", singleLine: true });

Custom Colors

const result = await logoWorkshopSDK.generateLogo({ words: "Ocean Life", emoji: "🐬", textColor: "#003366", accentColor: "#0099cc", secondaryColor: "#006699", bgColor: "#f0f8ff" });

Auto-Generated Emoji

const result = await logoWorkshopSDK.generateLogo({ words: "AI Assistant", // No emoji specified, will use EmojiSummarizer to generate one useEmojiSdk: true });

Debug Mode

const result = await logoWorkshopSDK.generateLogo({ words: "Test Logo", debug: true // Shows guide lines for positioning });

Integration with HTML

import { logoWorkshopSDK } from "https://esm.town/v/dcm31/logoWorkshopOpenMoji/sdk.tsx"; // In a browser environment: async function updateLogo() { const words = document.getElementById("logoText").value; const svgString = await logoWorkshopSDK.generateLogoSvg({ words }); document.getElementById("logoContainer").innerHTML = svgString; }

Key Limitations

  • The SDK does not support custom sizing of the overall logo (fixed at 301x113.266)
  • Only OpenMoji emoji set is supported
  • Text X position is fixed at 112px and cannot be changed
  • Single-line mode requires at least one space in the text to trigger the color split effect
FeaturesVersion controlCode intelligenceCLIMCP
Use cases
TeamsAI agentsSlackGTM
DocsShowcaseTemplatesNewestTrendingAPI examplesNPM packages
PricingNewsletterBlogAboutCareers
We’re hiring!
Brandhi@val.townStatus
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Open Source Pledge
Terms of usePrivacy policyAbuse contact
Β© 2025 Val Town, Inc.