惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

A
About on SuperTechFans
C
Cybersecurity and Infrastructure Security Agency CISA
N
News and Events Feed by Topic
C
Cisco Blogs
Cisco Talos Blog
Cisco Talos Blog
A
Arctic Wolf
Scott Helme
Scott Helme
P
Palo Alto Networks Blog
S
Schneier on Security
D
Darknet – Hacking Tools, Hacker News & Cyber Security
T
Tor Project blog
量子位
G
Google Developers Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
B
Blog RSS Feed
NISL@THU
NISL@THU
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
AWS News Blog
AWS News Blog
爱范儿
爱范儿
Last Week in AI
Last Week in AI
Y
Y Combinator Blog
L
LINUX DO - 最新话题
Security Archives - TechRepublic
Security Archives - TechRepublic
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
S
Secure Thoughts
Cloudbric
Cloudbric
aimingoo的专栏
aimingoo的专栏
L
Lohrmann on Cybersecurity
TaoSecurity Blog
TaoSecurity Blog
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Hacker News: Ask HN
Hacker News: Ask HN
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
The GitHub Blog
The GitHub Blog
有赞技术团队
有赞技术团队
S
Security @ Cisco Blogs
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
C
Cyber Attacks, Cyber Crime and Cyber Security
G
GRAHAM CLULEY
P
Proofpoint News Feed
V
V2EX
Martin Fowler
Martin Fowler
C
CERT Recently Published Vulnerability Notes
Attack and Defense Labs
Attack and Defense Labs
C
CXSECURITY Database RSS Feed - CXSecurity.com
The Cloudflare Blog
SecWiki News
SecWiki News
罗磊的独立博客
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
小众软件
小众软件
The Last Watchdog
The Last Watchdog

ImageKit.io Blog

Next.js Image Optimization with ImageKit Use Video as a Background in Your Next.js Project How to Fix Autoplay Video in Next.js How Durian Scaled a Visual-First Retail Experience to 350K Monthly Visitors Online How Matsmart accelerated image delivery across countries with ImageKit AI in Digital Asset Management: From Smart Workflows to Agentic Automation How Joseph Joseph unified and secured global video delivery with ImageKit How Modall powers fast, effortless media delivery across 40+ projects with ImageKit Digital Asset Management (DAM) Trends: 2026 Report How to add a poster image to Video.js player (and automate it) HLS streaming with Video.js + React Building the future of storytelling with fast, AI-powered video delivery How PushOwl delivers 100M+ image-rich notifications seamlessly with ImageKit How Homify delivers millions of interior design images seamlessly with ImageKit Better event discovery with lightning‑fast videos & images Adding video player in React Native Video player in Angular applications Crop and resize videos in React Next.js image and video upload React image and video upload React video optimization How we quadrupled our traffic to 625K monthly page views How Apollo 24|7 boosted performance & reduced costs with ImageKit Simplify your media workflows with ImageKit DAM integrations Extending Lighthouse for custom image and video optimization analysis Brand Asset Management: What is it? How does it work? WordPress Digital Asset Management Guide - Manage your WP media assets better Why Shopify retailers need a digital asset management solution DAM vs. SharePoint: Which is best for you? AI-powered Metadata and Tagging in Digital Asset Management How Hopscotch built India's largest online Kids' fashion brand with ImageKit Dropbox Vs. DAM: Which Is The Right Tool For Digital Asset Management Digital Asset Management for Photographers: A Complete Guide Why digital asset management for agencies is essential Helping both Top and Bottom Line: SaffronStays rapid, profitable growth with ImageKit How KreditBee simplified media experiences with ImageKit Google Drive alternatives for businesses (with fast-growing teams) Node.js image upload ImageKit: The Secret Ingredient in Swiggy’s Expansion Journey Streamlining the Design Approval Process: A Comprehensive Guide AV1 Codec - Complete guide for video application devs PHP image and video upload Angular image & video upload AV1 vs VP9: Which codec should you choose? Adding video player in Next.js React Video Player VP8 vs VP9 - In the context of online video delivery Exploring WebM vs MP4 7 Free Digital Asset Management Software that are not Open-Source Comparing 9 Top Digital Asset Management Tools in the Market What are Brand Standards and Why do they Matter? Boost Sales and Brand Appeal: Essential Tips for eCommerce Image Management Brand Recall: The Strategy to Create Unforgettable Brands How to upload files in HTML? Branding for Small Businesses (2025 Edition) Everything you need to know about VP9 codec Recent updates from ImageKit and what's next Best Ways to Write RFP For Digital Asset Management (+ with free RFP template) What is Brand Dilution? How to Avoid It? Explained with [Examples] The Importance of Brand Identity: Leveraging Digital Asset Management for Impact From Launch to Scale: How to Launch a Brand Campaign Digital Asset Management Requirements - What do You Need to Evaluate and How? Marketing Collateral Management: A Quick End-to-End Guide Video Content Management System: What Is It And How To Choose One? Dropbox vs. Google Drive vs. Onedrive: The Best Cloud Storage Solution How to Build Brand Trust: Get Started In 2025 Google Drive vs. Box: A Detailed Comparison How Digital Asset Management Solutions Help Protect Brand Equity A DAM Solution Can Safeguard Your Digital Intellectual Property - Here’s How WebP Vs. PNG: Which Image Format Should You Use and Why? How to Resize Images in Bootstrap Easily Progressive jpegs (PJPEG): the key to loading images faster on your website Dropbox vs. Google Drive: The Best Cloud Storage For Digital Assets Dropbox Pros & Cons In 2024: An In-Depth Analysis and Why A DAM Solution Stands Out Google Drive Vs OneDrive: The Better Storage Option For Digital Assets Manage your video assets better with video metadata Understanding DAM's Role in Strengthening Brand Identity Digital asset management strategy: What to know before creating one The Ultimate Guide To Marketing Agency Onboarding 6 Solutions To Simplify Large File Sharing Over The Web A Step-by-Step Breakdown of a Video Production Workflow 13 Digital Asset Management Use Cases You Should Know How to Conduct a Brand Audit and Manage Your Brand Assets Costly Consequences of Inconsistent Branding And How DAM Can Help Dynamic Asset Transformation: What It Is, Why You Need It, and How ImageKit Can Help Everything You Need to Know About HTML Video Autoplay How To Select Your DAM Vendor: A Complete Guide How to Boost User Experience with Smart Digital Asset Management React Image Optimization: A Guide for Web Developers Why Should DAM Be A Part Of Your MarTech Stack? Unleashing the Power of Content Repurposing with ImageKit MKV vs MP4: Which Video File Format Is Better for Your Needs? Digital Asset Management For Ecommerce: A Complete Guide How an Image Tagging Software can Transform Your Image Search How to Manage Your Content Lifecycle Effectively M4V vs MP4: Which Video Format Should You Use and Why? Why Every Business Needs An Image Management System All The Questions To Ask During A Dam Demo Which is the Best Image Format for Your Website? Uploading Multiple Files Using JavaScript: A Comprehensive Guide
Seamless image optimization and uploads in your Angular app with ImageKit
Jay Parekh · 2020-06-18 · via ImageKit.io Blog

ImageKit.io lets you fetch images from your storage after applying real-time transformations. You specify the transformations to be applied through URL parameters in the image URL. Generating the image URL programmatically in front-end application can be a non-trivial task. In addition to this, uploading a file to your ImageKit.io media library straight from the client-side requires certain authentication-related operations to be performed.

ImageKit client-end SDKs serve the purpose of simplifying these processes by exposing pre-written, framework-specific code modules for these operations.

ImageKit.io provides SDKs for all major front-end frameworks, including Angular, React, and Vue.js. This article will look at how you can set up a simple Angular application and integrate the ImageKit.io SDK into it to expose ImageKit functionality to your users.

Prerequisites:

Note: If you want to explore how the ImageKit SDK is utilized by an Angular app, there are pre-built sample Angular apps for every version (v4-v9). Refer to the docs for this.

Step 1: Create a New Angular Application

Navigate to your preferred directory and run:

ng new sample-imagekit-app

Step 2: Install the ImageKit Angular SDK package from npm

Inside the sample-imagekit-app directory, run

npm install imagekitio-angular

This will download the Angular SDK package from the npm registry, and add it to the dependencies list of your Angular app (unless you're using npm <5.0.0)

Step 3: Get your ImageKit Public Key
In your ImageKit account dashboard, go to API Keys section from the navigation bar. Note down your public API key.

Step 4: Initial Configuration of the ImageKit SDK in your App
You will need to import the imagekitio-angular module in your application. Go to the src/app/app.module.ts and configure it like this:

import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';

import { AppComponent } from './app.component';

import { ImagekitioAngularModule } from 'imagekitio-angular';

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    ImagekitioAngularModule.forRoot({
      publicKey: environment.publicKey,
      urlEndpoint: environment.urlEndpoint,
      authenticationEndpoint: environment.authenticationEndpoint
    })
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }

publicKey and urlEndpoint are mandatory parameters for SDK initialization.

authenticationEndpoint is essential if you want to use the SDK for client-side uploads. publicKey should be your ImageKit account's public key, which we discovered in step 3. The SDK makes an HTTP GET request to this endpoint and expects a JSON response with three fields i.e. signature, token and expire. You must implement this API endpoint in your backend using ImageKit.io server-side SDKs. Learn more about this process.

NOTE: Never publish your private key on your front-end / client-side apps. The Private API key should be kept confidential and only stored on your backend servers.

Once you've configured these and the backend API to generate a signature for uploads, you can start using the SDK to fetch transformed images from or upload new images to your ImageKit account.

The ImageKit Angular SDK

The library includes 2 components:

  • ik-image
  • ik-upload

ik-image

The ik-image tag allows you to fetch an image with applied transformations from your ImageKit storage. You can specify the source of the image with either the path option, or the src option.
transformation option is optional, and specifies what transformations are to be applied to the image. It is an array of objects, where the transformations are applied in sequential order based on the order of the transformation objects in the array. Transformation object at array index 0 is applied first, 1 second, and so on...

path should be the directory-based location of the image in your storage (the part of the URL that comes after urlEndpoint). Thus, the complete URL of the image is urlEndpoint + path. Example:

<ik-image path="/default-directory/default-image.jpg" transformation={[{
  "height": "300",
  "width": "400"
}]}></ik-image>

src on the other end, is the complete URL of the image to be fetched. Example:

<ik-image 
    src="<full_image_url_from_db>" 
    transformation={[{
    "height": "300",
    "width": "400"
  }]}
  ></ik-image>

Applying Transforms

const transformations = [{
  width: 90,
  height: 180
}]

<ik-image style="" src="<full_image_url_from_db>" transformations = {transformations}></ik-image>

The above image will apply transformation of width = 90 and height = 180 on the image. Since some transformations are destructive you might want to control the order in which the transforms are applied.
This SDK supports aliases for most transformations supported by ImageKit to improve readability. These aliases can be found here. If you cannot find an alias for the transformation you want, you can use the original name for that transformation as specified in the ImageKit docs.

Low Quality Image Placeholders (LQIP) for image
The SDK supports LQIP for your images, if you set lqip to true in the image component. LQIP allows you to temporarily load a lower quality image on the webpage, until the original image is loaded in the background.  This greatly improves the visual appeal of the page when it's loading.

<ik-image style="" src="<full_image_url_from_db>" lqip={​{active:true, quality: 20}​}></ik-image>

The value of active can be either true or false, depending on whether you want this functionality or not. quality specifies the quality of the placeholder image. It can be any numeric value. A low number means lower quality (small file size), while a higher number means higher quality.

ik-upload

The SDK provides a simple Component to upload files to the ImageKit Media Library. It has an attribute called fileName, which is used by SDK for fileName parameter required to upload. The file parameter is provided as an input from the user.

Besides this, make sure that you have set up the signature generation API endpoint in your back-end. This endpoint should be assigned to the authenticationEndpoint option during SDK initialization.

Example:

// Simple upload
<ik-upload fileName="my-upload" /></ik-upload>

// Using callbacks and other parameters of upload API
<ik-upload fileName="test_new" [useUniqueFileName]="false" [isPrivateFile]="true"
    (onSuccess)="handleUploadSuccess($event)" (onError)="handleUploadError($event)"></ik-upload>

ik-upload component accepts all the parameters supported by the ImageKit Upload API as attributes e.g. tags, useUniqueFileName, folder, isPrivateFile, customCoordinates etc.

Let us know if you have any questions or create an issue on the Github repo.